Skip to content

Commit

Permalink
Pass JSI Dynamic filter callback by ref
Browse files Browse the repository at this point in the history
Summary:
X-link: facebook/react-native#48242

This std::function is immediately invoked, no need to copy it around.

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D67093042

fbshipit-source-id: 2b863fb1857da73568afaf6f3d3c8c7bbef0d61b
  • Loading branch information
javache authored and facebook-github-bot committed Dec 12, 2024
1 parent 641f8dd commit cf80756
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion API/jsi/jsi/JSIDynamic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void dynamicFromValueShallow(
folly::dynamic dynamicFromValue(
Runtime& runtime,
const Value& valueInput,
std::function<bool(const std::string&)> filterObjectKeys) {
const std::function<bool(const std::string&)>& filterObjectKeys) {
std::vector<FromValue> stack;
folly::dynamic ret;

Expand Down
2 changes: 1 addition & 1 deletion API/jsi/jsi/JSIDynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ facebook::jsi::Value valueFromDynamic(
folly::dynamic dynamicFromValue(
facebook::jsi::Runtime& runtime,
const facebook::jsi::Value& value,
std::function<bool(const std::string&)> filterObjectKeys = nullptr);
const std::function<bool(const std::string&)>& filterObjectKeys = nullptr);

} // namespace jsi
} // namespace facebook

0 comments on commit cf80756

Please sign in to comment.