Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ struct ArrayPropsNativeComponentViewObjectStruct {
};

static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ArrayPropsNativeComponentViewObjectStruct &result) {
auto map = (butter::map<std::string, RawValue>)value;
auto map = (std::unordered_map<std::string, RawValue>)value;

auto tmp_prop = map.find(\\"prop\\");
if (tmp_prop != map.end()) {
Expand Down Expand Up @@ -115,7 +115,7 @@ struct ArrayPropsNativeComponentViewArrayOfObjectsStruct {
};

static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ArrayPropsNativeComponentViewArrayOfObjectsStruct &result) {
auto map = (butter::map<std::string, RawValue>)value;
auto map = (std::unordered_map<std::string, RawValue>)value;

auto tmp_prop1 = map.find(\\"prop1\\");
if (tmp_prop1 != map.end()) {
Expand Down Expand Up @@ -796,7 +796,7 @@ struct ObjectPropsNativeComponentObjectPropStruct {
};

static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsNativeComponentObjectPropStruct &result) {
auto map = (butter::map<std::string, RawValue>)value;
auto map = (std::unordered_map<std::string, RawValue>)value;

auto tmp_stringProp = map.find(\\"stringProp\\");
if (tmp_stringProp != map.end()) {
Expand Down Expand Up @@ -833,7 +833,7 @@ struct ObjectPropsNativeComponentObjectArrayPropStruct {
};

static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsNativeComponentObjectArrayPropStruct &result) {
auto map = (butter::map<std::string, RawValue>)value;
auto map = (std::unordered_map<std::string, RawValue>)value;

auto tmp_array = map.find(\\"array\\");
if (tmp_array != map.end()) {
Expand All @@ -852,7 +852,7 @@ struct ObjectPropsNativeComponentObjectPrimitiveRequiredPropStruct {
};

static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsNativeComponentObjectPrimitiveRequiredPropStruct &result) {
auto map = (butter::map<std::string, RawValue>)value;
auto map = (std::unordered_map<std::string, RawValue>)value;

auto tmp_image = map.find(\\"image\\");
if (tmp_image != map.end()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const StructTemplate = ({
};

static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ${structName} &result) {
auto map = (butter::map<std::string, RawValue>)value;
auto map = (std::unordered_map<std::string, RawValue>)value;

${fromCases}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ struct ArrayPropsNativeComponentObjectStruct {
};

static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ArrayPropsNativeComponentObjectStruct &result) {
auto map = (butter::map<std::string, RawValue>)value;
auto map = (std::unordered_map<std::string, RawValue>)value;

auto tmp_stringProp = map.find(\\"stringProp\\");
if (tmp_stringProp != map.end()) {
Expand All @@ -113,7 +113,7 @@ struct ArrayPropsNativeComponentArrayObjectStruct {
};

static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ArrayPropsNativeComponentArrayObjectStruct &result) {
auto map = (butter::map<std::string, RawValue>)value;
auto map = (std::unordered_map<std::string, RawValue>)value;

auto tmp_stringProp = map.find(\\"stringProp\\");
if (tmp_stringProp != map.end()) {
Expand All @@ -140,7 +140,7 @@ struct ArrayPropsNativeComponentArrayStruct {
};

static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ArrayPropsNativeComponentArrayStruct &result) {
auto map = (butter::map<std::string, RawValue>)value;
auto map = (std::unordered_map<std::string, RawValue>)value;

auto tmp_object = map.find(\\"object\\");
if (tmp_object != map.end()) {
Expand All @@ -167,7 +167,7 @@ struct ArrayPropsNativeComponentArrayOfArrayOfObjectStruct {
};

static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ArrayPropsNativeComponentArrayOfArrayOfObjectStruct &result) {
auto map = (butter::map<std::string, RawValue>)value;
auto map = (std::unordered_map<std::string, RawValue>)value;

auto tmp_stringProp = map.find(\\"stringProp\\");
if (tmp_stringProp != map.end()) {
Expand Down Expand Up @@ -251,7 +251,7 @@ struct ArrayPropsNativeComponentNativePrimitivesStruct {
};

static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ArrayPropsNativeComponentNativePrimitivesStruct &result) {
auto map = (butter::map<std::string, RawValue>)value;
auto map = (std::unordered_map<std::string, RawValue>)value;

auto tmp_colors = map.find(\\"colors\\");
if (tmp_colors != map.end()) {
Expand Down Expand Up @@ -1151,7 +1151,7 @@ struct ObjectPropsObjectPropObjectArrayPropStruct {
};

static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsObjectPropObjectArrayPropStruct &result) {
auto map = (butter::map<std::string, RawValue>)value;
auto map = (std::unordered_map<std::string, RawValue>)value;

auto tmp_array = map.find(\\"array\\");
if (tmp_array != map.end()) {
Expand All @@ -1170,7 +1170,7 @@ struct ObjectPropsObjectPropObjectPrimitiveRequiredPropStruct {
};

static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsObjectPropObjectPrimitiveRequiredPropStruct &result) {
auto map = (butter::map<std::string, RawValue>)value;
auto map = (std::unordered_map<std::string, RawValue>)value;

auto tmp_image = map.find(\\"image\\");
if (tmp_image != map.end()) {
Expand All @@ -1195,7 +1195,7 @@ struct ObjectPropsObjectPropNestedPropANestedPropBStruct {
};

static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsObjectPropNestedPropANestedPropBStruct &result) {
auto map = (butter::map<std::string, RawValue>)value;
auto map = (std::unordered_map<std::string, RawValue>)value;

auto tmp_nestedPropC = map.find(\\"nestedPropC\\");
if (tmp_nestedPropC != map.end()) {
Expand All @@ -1212,7 +1212,7 @@ struct ObjectPropsObjectPropNestedPropAStruct {
};

static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsObjectPropNestedPropAStruct &result) {
auto map = (butter::map<std::string, RawValue>)value;
auto map = (std::unordered_map<std::string, RawValue>)value;

auto tmp_nestedPropB = map.find(\\"nestedPropB\\");
if (tmp_nestedPropB != map.end()) {
Expand All @@ -1229,7 +1229,7 @@ struct ObjectPropsObjectPropNestedArrayAsPropertyArrayPropStruct {
};

static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsObjectPropNestedArrayAsPropertyArrayPropStruct &result) {
auto map = (butter::map<std::string, RawValue>)value;
auto map = (std::unordered_map<std::string, RawValue>)value;

auto tmp_stringProp = map.find(\\"stringProp\\");
if (tmp_stringProp != map.end()) {
Expand All @@ -1256,7 +1256,7 @@ struct ObjectPropsObjectPropNestedArrayAsPropertyStruct {
};

static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsObjectPropNestedArrayAsPropertyStruct &result) {
auto map = (butter::map<std::string, RawValue>)value;
auto map = (std::unordered_map<std::string, RawValue>)value;

auto tmp_arrayProp = map.find(\\"arrayProp\\");
if (tmp_arrayProp != map.end()) {
Expand All @@ -1282,7 +1282,7 @@ struct ObjectPropsObjectPropStruct {
};

static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ObjectPropsObjectPropStruct &result) {
auto map = (butter::map<std::string, RawValue>)value;
auto map = (std::unordered_map<std::string, RawValue>)value;

auto tmp_stringProp = map.find(\\"stringProp\\");
if (tmp_stringProp != map.end()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#import <React/RCTConversions.h>
#import <React/RCTLog.h>

#import <butter/map.h>
#import <shared_mutex>
#import <unordered_map>
#import <unordered_set>

#import <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
Expand Down Expand Up @@ -59,7 +59,7 @@ void RCTInstallNativeComponentRegistryBinding(facebook::jsi::Runtime &runtime)
}

@implementation RCTComponentViewFactory {
butter::map<ComponentHandle, RCTComponentViewClassDescriptor> _componentViewClasses;
std::unordered_map<ComponentHandle, RCTComponentViewClassDescriptor> _componentViewClasses;
std::unordered_set<std::string> _registeredComponentsNames;
ComponentDescriptorProviderRegistry _providerRegistry;
std::shared_mutex _mutex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@
#import <React/RCTImageComponentView.h>
#import <React/RCTParagraphComponentView.h>
#import <React/RCTViewComponentView.h>

#import <butter/map.h>
#import <unordered_map>

using namespace facebook;
using namespace facebook::react;

const NSInteger RCTComponentViewRegistryRecyclePoolMaxSize = 1024;

@implementation RCTComponentViewRegistry {
butter::map<Tag, RCTComponentViewDescriptor> _registry;
butter::map<ComponentHandle, std::vector<RCTComponentViewDescriptor>> _recyclePool;
std::unordered_map<Tag, RCTComponentViewDescriptor> _registry;
std::unordered_map<ComponentHandle, std::vector<RCTComponentViewDescriptor>> _recyclePool;
}

- (instancetype)init
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#import "RCTMountingManager.h"

#import <QuartzCore/QuartzCore.h>
#import <butter/map.h>

#import <React/RCTAssert.h>
#import <React/RCTComponent.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
*/

#import <React/RCTComponentViewDescriptor.h>
#import <unordered_map>
#import <unordered_set>
#import "RCTMountingTransactionObserverCoordinator.h"

#import <butter/map.h>
#import "RCTMountingTransactionObserverCoordinator.h"

#include <react/renderer/mounting/MountingTransaction.h>

Expand Down Expand Up @@ -38,7 +38,7 @@ class RCTMountingTransactionObserverCoordinator final {
const facebook::react::SurfaceTelemetry& surfaceTelemetry) const;

private:
facebook::butter::map<
std::unordered_map<
facebook::react::SurfaceId,
std::unordered_set<RCTComponentViewDescriptor>>
registry_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <memory>
#include <shared_mutex>
#include <unordered_map>

#include <fbjni/fbjni.h>
#include <react/jni/JRuntimeExecutor.h>
Expand Down Expand Up @@ -139,7 +140,7 @@ class Binding : public jni::HybridClass<Binding>,

BackgroundExecutor backgroundExecutor_;

butter::map<SurfaceId, SurfaceHandler> surfaceHandlerRegistry_{};
std::unordered_map<SurfaceId, SurfaceHandler> surfaceHandlerRegistry_{};
std::shared_mutex
surfaceHandlerRegistryMutex_; // Protects `surfaceHandlerRegistry_`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#pragma once

#include <mutex>
#include <unordered_map>
#include <unordered_set>

#include <fbjni/fbjni.h>
Expand Down Expand Up @@ -58,7 +59,8 @@ class FabricMountingManager final {

std::recursive_mutex commitMutex_;

butter::map<SurfaceId, std::unordered_set<Tag>> allocatedViewRegistry_{};
std::unordered_map<SurfaceId, std::unordered_set<Tag>>
allocatedViewRegistry_{};
std::recursive_mutex allocatedViewsMutex_;

const bool reduceDeleteCreateMutation_{false};
Expand Down
6 changes: 0 additions & 6 deletions packages/react-native/ReactCommon/butter/.clang-tidy

This file was deleted.

45 changes: 0 additions & 45 deletions packages/react-native/ReactCommon/butter/map.h

This file was deleted.

7 changes: 0 additions & 7 deletions packages/react-native/ReactCommon/react/bridging/Object.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <react/bridging/AString.h>
#include <react/bridging/Base.h>

#include <butter/map.h>
#include <map>
#include <unordered_map>

Expand Down Expand Up @@ -83,12 +82,6 @@ struct Bridging {

} // namespace map_detail

#ifdef BUTTER_USE_FOLLY_CONTAINERS
template <typename... Args>
struct Bridging<butter::map<std::string, Args...>>
: map_detail::Bridging<butter::map<std::string, Args...>> {};
#endif

template <typename... Args>
struct Bridging<std::map<std::string, Args...>>
: map_detail::Bridging<std::map<std::string, Args...>> {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <react/renderer/core/graphicsConversions.h>
#include <react/renderer/core/propsConversions.h>
#include <cmath>
#include <unordered_map>

#ifdef ANDROID
#include <react/renderer/mapbuffer/MapBuffer.h>
Expand Down Expand Up @@ -747,7 +748,7 @@ inline void fromRawValue(
const PropsParserContext& context,
const RawValue& value,
AttributedString::Range& result) {
auto map = (butter::map<std::string, int>)value;
auto map = (std::unordered_map<std::string, int>)value;

auto start = map.find("start");
if (start != map.end()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#pragma once

#include <shared_mutex>
#include <unordered_map>

#include <react/renderer/componentregistry/ComponentDescriptorProvider.h>
#include <react/renderer/componentregistry/ComponentDescriptorRegistry.h>
Expand Down Expand Up @@ -60,7 +61,7 @@ class ComponentDescriptorProviderRegistry final {
mutable std::shared_mutex mutex_;
mutable std::vector<std::weak_ptr<const ComponentDescriptorRegistry>>
componentDescriptorRegistries_;
mutable butter::map<ComponentHandle, ComponentDescriptorProvider const>
mutable std::unordered_map<ComponentHandle, ComponentDescriptorProvider const>
componentDescriptorProviders_;
mutable ComponentDescriptorProviderRequest
componentDescriptorProviderRequest_{};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

#include <memory>
#include <shared_mutex>

#include <butter/map.h>
#include <unordered_map>

#include <react/renderer/componentregistry/ComponentDescriptorProvider.h>
#include <react/renderer/core/ComponentDescriptor.h>
Expand Down Expand Up @@ -82,9 +81,10 @@ class ComponentDescriptorRegistry {
void add(ComponentDescriptorProvider componentDescriptorProvider) const;

mutable std::shared_mutex mutex_;
mutable butter::map<ComponentHandle, SharedComponentDescriptor>
mutable std::unordered_map<ComponentHandle, SharedComponentDescriptor>
_registryByHandle;
mutable butter::map<std::string, SharedComponentDescriptor> _registryByName;
mutable std::unordered_map<std::string, SharedComponentDescriptor>
_registryByName;
ComponentDescriptor::Shared _fallbackComponentDescriptor;
ComponentDescriptorParameters parameters_{};
const ComponentDescriptorProviderRegistry& providerRegistry_;
Expand Down
Loading