From bbf093a03b0eef7977fc5d27aa95f96150a13e59 Mon Sep 17 00:00:00 2001 From: Ashok Menon Date: Thu, 27 Jun 2019 09:57:36 -0700 Subject: [PATCH] Remove const_cast in createSnapshotFromFile wrapper. Summary: The function is not annotated with `const` so `plain()` will return a non-const reference to the undecorated Runtime already. Seems like the const_cast was a hold-over from a previous iteration. Reviewed By: mhorowitz Differential Revision: D16016320 fbshipit-source-id: 3dfa1e9acf2fc5c1ad61c9a8cd27c3c2e42036d3 --- ReactCommon/jsi/jsi/decorator.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ReactCommon/jsi/jsi/decorator.h b/ReactCommon/jsi/jsi/decorator.h index c073569287b..a2ce31a787f 100644 --- a/ReactCommon/jsi/jsi/decorator.h +++ b/ReactCommon/jsi/jsi/decorator.h @@ -334,8 +334,7 @@ class RuntimeDecorator : public Base, private jsi::Instrumentation { } bool createSnapshotToFile(const std::string& path, bool compact) override { - return const_cast(plain()).instrumentation().createSnapshotToFile( - path, compact); + return plain().instrumentation().createSnapshotToFile(path, compact); } void writeBridgeTrafficTraceToFile(