Remove ReactFeatureFlags.enableSpannableCache

Summary:
This diff removes the feature flag ReactFeatureFlags.enableSpannableCache and it's already disabled MC

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D39449840

fbshipit-source-id: 69a514b611c1179f2160a1bfd4c4199538738448
This commit is contained in:
David Vacca
2022-09-13 09:48:57 -07:00
committed by Facebook GitHub Bot
parent 6f92a05c10
commit 4d74b4ae61
3 changed files with 4 additions and 53 deletions
@@ -103,9 +103,6 @@ public class ReactFeatureFlags {
*/
public static boolean enableLargeTextMeasureCache = true;
/** TODO: T113245006 Delete this flag. Enables caching of spannables for text */
public static boolean enableSpannableCache = false;
public static boolean dispatchPointerEvents = false;
/** Feature Flag to enable the pending event queue in fabric before mounting views */
@@ -31,7 +31,6 @@ import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableNativeMap;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.common.build.ReactBuildConfig;
import com.facebook.react.config.ReactFeatureFlags;
import com.facebook.react.uimanager.PixelUtil;
import com.facebook.react.uimanager.ReactStylesDiffMap;
import com.facebook.react.uimanager.ViewProps;
@@ -193,30 +192,8 @@ public class TextLayoutManager {
ReadableMap attributedString,
@Nullable ReactTextViewManagerCallback reactTextViewManagerCallback) {
Spannable preparedSpannableText;
if (ReactFeatureFlags.enableSpannableCache) {
synchronized (sSpannableCacheLock) {
preparedSpannableText = sSpannableCache.get((ReadableNativeMap) attributedString);
if (preparedSpannableText != null) {
return preparedSpannableText;
}
}
preparedSpannableText =
createSpannableFromAttributedString(
context, attributedString, reactTextViewManagerCallback);
synchronized (sSpannableCacheLock) {
sSpannableCache.put((ReadableNativeMap) attributedString, preparedSpannableText);
}
} else {
preparedSpannableText =
createSpannableFromAttributedString(
context, attributedString, reactTextViewManagerCallback);
}
return preparedSpannableText;
return createSpannableFromAttributedString(
context, attributedString, reactTextViewManagerCallback);
}
private static Spannable createSpannableFromAttributedString(
@@ -29,7 +29,6 @@ import com.facebook.react.bridge.ReactSoftExceptionLogger;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.common.build.ReactBuildConfig;
import com.facebook.react.common.mapbuffer.MapBuffer;
import com.facebook.react.config.ReactFeatureFlags;
import com.facebook.react.uimanager.PixelUtil;
import com.facebook.yoga.YogaConstants;
import com.facebook.yoga.YogaMeasureMode;
@@ -209,30 +208,8 @@ public class TextLayoutManagerMapBuffer {
MapBuffer attributedString,
@Nullable ReactTextViewManagerCallback reactTextViewManagerCallback) {
Spannable preparedSpannableText;
if (ReactFeatureFlags.enableSpannableCache) {
synchronized (sSpannableCacheLock) {
preparedSpannableText = sSpannableCache.get(attributedString);
if (preparedSpannableText != null) {
return preparedSpannableText;
}
}
preparedSpannableText =
createSpannableFromAttributedString(
context, attributedString, reactTextViewManagerCallback);
synchronized (sSpannableCacheLock) {
sSpannableCache.put(attributedString, preparedSpannableText);
}
} else {
preparedSpannableText =
createSpannableFromAttributedString(
context, attributedString, reactTextViewManagerCallback);
}
return preparedSpannableText;
return createSpannableFromAttributedString(
context, attributedString, reactTextViewManagerCallback);
}
private static Spannable createSpannableFromAttributedString(