mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Remove yoga/internal/experiments (#1195)
Summary: X-link: https://github.com/facebook/yoga/pull/1195 These files are remnants of experimentation functions from D16687367 (https://github.com/facebook/react-native/commit/c9b757f5135d31c48237a6148393568a26ab65fc). They do not seem to be included anywhere anymore, and we already have a YGExperimentalFeature setter in config we can use in the more common case. Changelog: [Internal] Reviewed By: christophpurrer Differential Revision: D42241980 fbshipit-source-id: 482984b9a619dba8042e9166aee02a5e75e761ee
This commit is contained in:
committed by
Facebook GitHub Bot
parent
874881e73e
commit
255d648101
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "experiments.h"
|
||||
|
||||
#include <bitset>
|
||||
|
||||
namespace facebook {
|
||||
namespace yoga {
|
||||
namespace internal {
|
||||
|
||||
namespace detail {
|
||||
extern std::bitset<sizeof(int)> enabledExperiments;
|
||||
} // namespace detail
|
||||
|
||||
inline bool isEnabled(Experiment experiment) {
|
||||
return detail::enabledExperiments.test(static_cast<size_t>(experiment));
|
||||
}
|
||||
|
||||
inline void disableAllExperiments() {
|
||||
detail::enabledExperiments = 0;
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace yoga
|
||||
} // namespace facebook
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include "experiments.h"
|
||||
#include "experiments-inl.h"
|
||||
|
||||
namespace facebook {
|
||||
namespace yoga {
|
||||
namespace internal {
|
||||
|
||||
namespace detail {
|
||||
|
||||
std::bitset<sizeof(int)> enabledExperiments = 0;
|
||||
|
||||
} // namespace detail
|
||||
|
||||
void enable(Experiment experiment) {
|
||||
detail::enabledExperiments.set(static_cast<size_t>(experiment));
|
||||
}
|
||||
|
||||
void disable(Experiment experiment) {
|
||||
detail::enabledExperiments.reset(static_cast<size_t>(experiment));
|
||||
}
|
||||
|
||||
bool toggle(Experiment experiment) {
|
||||
auto bit = static_cast<size_t>(experiment);
|
||||
auto previousState = detail::enabledExperiments.test(bit);
|
||||
detail::enabledExperiments.flip(bit);
|
||||
return previousState;
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace yoga
|
||||
} // namespace facebook
|
||||
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
namespace facebook {
|
||||
namespace yoga {
|
||||
namespace internal {
|
||||
|
||||
enum struct Experiment : size_t {
|
||||
kDoubleMeasureCallbacks,
|
||||
};
|
||||
|
||||
void enable(Experiment);
|
||||
void disable(Experiment);
|
||||
bool toggle(Experiment);
|
||||
|
||||
} // namespace internal
|
||||
} // namespace yoga
|
||||
} // namespace facebook
|
||||
Reference in New Issue
Block a user