docstring_tokens
stringlengths
18
16.9k
code_tokens
stringlengths
75
1.81M
html_url
stringlengths
74
116
file_name
stringlengths
3
311
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> auto res = sgn.finalize(tmp.value()); <mask> <mask> if (res.hasValue()) { <mask> src->advance(m - src->data()); <mask> } <mask> <mask> return res; <mask> } <mask> </s> [sdk33] Update iOS with RN 0.59 </s> remove size = e - b; </s> add size = size_t(e - b); </s> remove if (q1 == q2) return unconst(q1); </s> add if (q1 == q2) { return unconst(q1); } </s> remove result += sum; </s> add result += UT(sum); </s> remove reference front() { assert(!empty()); return *begin(); } reference back() { assert(!empty()); return *(end() - 1); } const_reference front() const { assert(!empty()); return *begin(); } const_reference back() const { assert(!empty()); return *(end() - 1); } </s> add reference front() { assert(!empty()); return *begin(); } reference back() { assert(!empty()); return *(end() - 1); } const_reference front() const { assert(!empty()); return *begin(); } const_reference back() const { assert(!empty()); return *(end() - 1); } </s> remove out.append(&*last, p - last); </s> add out.append(&*last, size_t(p - last)); </s> remove RWSpinLock::ReadHolder rh(&vault_.stateMutex_); if (vault_.state_ == SingletonVault::SingletonVaultState::Quiescing) { if (vault_.type_ != SingletonVault::Type::Relaxed) { LOG(FATAL) << "Requesting singleton after vault was destroyed."; } </s> add auto state = vault_.state_.rlock(); if (vault_.type_ != SingletonVault::Type::Relaxed && !state->registrationComplete) { detail::singletonWarnCreateBeforeRegistrationCompleteAndAbort(type()); } if (state->state == detail::SingletonVaultState::Type::Quiescing) {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/Conv.cpp
keep replace keep keep keep keep keep
<mask> /* <mask> * Copyright 2016 Facebook, Inc. <mask> * <mask> * Licensed under the Apache License, Version 2.0 (the "License"); <mask> * you may not use this file except in compliance with the License. <mask> * You may obtain a copy of the License at <mask> * </s> [sdk33] Update iOS with RN 0.59
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/Conv.h
keep keep keep keep replace keep keep keep keep keep
<mask> #include <type_traits> <mask> #include <typeinfo> <mask> #include <utility> <mask> <mask> #include <boost/implicit_cast.hpp> <mask> #include <double-conversion/double-conversion.h> // V8 JavaScript implementation <mask> <mask> #include <folly/Demangle.h> <mask> #include <folly/Expected.h> <mask> #include <folly/FBString.h> </s> [sdk33] Update iOS with RN 0.59 </s> add #include <new> #include <type_traits> #include <typeinfo> #include <utility> #include <folly/CPortability.h> #include <folly/Demangle.h> </s> remove #include <boost/iterator/iterator_facade.hpp> </s> add #include <iterator> #include <type_traits> #include <utility> </s> add #include <cstdlib> #include <cstring> #include <iterator> #include <stdexcept> #include <type_traits> #include <utility> </s> remove #include <boost/operators.hpp> #include <folly/portability/BitsFunctexcept.h> </s> add #include <folly/Traits.h> #include <folly/Utility.h> #include <folly/lang/Exception.h> </s> remove #include <type_traits> #include <utility> namespace folly { enum class TLPDestructionMode { THIS_THREAD, ALL_THREADS }; struct AccessModeStrict {}; } // namespace </s> add </s> add #include <unordered_set> #include <vector>
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/Conv.h
keep keep keep keep replace replace replace replace replace keep keep keep keep replace replace keep
<mask> }; <mask> <mask> template<typename F, typename S> <mask> struct Dereferencer<std::pair<F, S>> { <mask> static inline void <mask> derefToCache(std::pair<F, S>* mem, const dynamic::const_item_iterator& it) { <mask> new (mem) std::pair<F, S>( <mask> convertTo<F>(it->first), convertTo<S>(it->second) <mask> ); <mask> } <mask> <mask> // Intentional duplication of the code in Dereferencer <mask> template <typename T> <mask> static inline void derefToCache(T* mem, const dynamic::const_iterator& it) { <mask> new (mem) T(convertTo<T>(*it)); <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove struct DynamicConverter<std::pair<F,S>> { </s> add struct DynamicConverter<std::pair<F, S>> { </s> remove inline std::move_iterator<Transformer<T, It>> conversionIterator(const It& it) { </s> add inline std::move_iterator<Transformer<T, It>> conversionIterator(const It& it) { </s> remove template<typename NodeAlloc> </s> add template <typename NodeAlloc> </s> remove public: explicit Transformer(const It& it) : Transformer::iterator_adaptor_(it), valid_(false) {} </s> add public: explicit Transformer(const It& it) : Transformer::iterator_adaptor_(it) {} </s> remove template<typename C> struct DynamicConstructor<C, </s> add template <typename C> struct DynamicConstructor< C,
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep keep keep keep replace replace replace replace replace keep keep keep keep replace replace keep keep keep
<mask> } <mask> }; <mask> <mask> template <typename T, typename It> <mask> class Transformer : public boost::iterator_adaptor< <mask> Transformer<T, It>, <mask> It, <mask> typename T::value_type <mask> > { <mask> friend class boost::iterator_core_access; <mask> <mask> typedef typename T::value_type ttype; <mask> <mask> mutable ttype cache_; <mask> mutable bool valid_; <mask> <mask> void increment() { <mask> ++this->base_reference(); </s> [sdk33] Update iOS with RN 0.59 </s> remove static inline void derefToCache(T* mem, const dynamic::const_iterator& it) { new (mem) T(convertTo<T>(*it)); </s> add static inline void derefToCache( Optional<T>* mem, const dynamic::const_iterator& it) { mem->emplace(convertTo<T>(*it)); </s> remove valid_ = false; </s> add cache_ = none; </s> remove template<class,class> friend class csl_iterator; </s> add template <class, class> friend class csl_iterator; </s> remove } // namespace folly </s> add namespace threadlocal_detail { template <typename> struct static_meta_of; template <typename T, typename Tag, typename AccessMode> struct static_meta_of<ThreadLocalPtr<T, Tag, AccessMode>> { using type = StaticMeta<Tag, AccessMode>; }; template <typename T, typename Tag, typename AccessMode> struct static_meta_of<ThreadLocal<T, Tag, AccessMode>> { using type = StaticMeta<Tag, AccessMode>; }; } // namespace threadlocal_detail } // namespace folly </s> remove void increment() { node_ = node_->next(); }; bool equal(const csl_iterator& other) const { return node_ == other.node_; } value_type& dereference() const { return node_->data(); } </s> add void increment() { node_ = node_->next(); } bool equal(const csl_iterator& other) const { return node_ == other.node_; } value_type& dereference() const { return node_->data(); }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep keep keep keep replace keep keep keep replace replace keep keep keep
<mask> mutable bool valid_; <mask> <mask> void increment() { <mask> ++this->base_reference(); <mask> valid_ = false; <mask> } <mask> <mask> ttype& dereference() const { <mask> if (LIKELY(!valid_)) { <mask> cache_.~ttype(); <mask> Dereferencer<ttype>::derefToCache(&cache_, this->base_reference()); <mask> valid_ = true; <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove valid_ = true; </s> add </s> remove mutable ttype cache_; mutable bool valid_; </s> add mutable Optional<ttype> cache_; </s> remove return cache_; </s> add return cache_.value(); </s> remove void increment() { node_ = node_->next(); }; bool equal(const csl_iterator& other) const { return node_ == other.node_; } value_type& dereference() const { return node_->data(); } </s> add void increment() { node_ = node_->next(); } bool equal(const csl_iterator& other) const { return node_ == other.node_; } value_type& dereference() const { return node_->data(); } </s> remove template<class,class> friend class csl_iterator; </s> add template <class, class> friend class csl_iterator;
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep keep keep keep replace keep replace keep
<mask> ttype& dereference() const { <mask> if (LIKELY(!valid_)) { <mask> cache_.~ttype(); <mask> Dereferencer<ttype>::derefToCache(&cache_, this->base_reference()); <mask> valid_ = true; <mask> } <mask> return cache_; <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove if (LIKELY(!valid_)) { cache_.~ttype(); </s> add if (!cache_) { </s> remove valid_ = false; </s> add cache_ = none; </s> remove mutable ttype cache_; mutable bool valid_; </s> add mutable Optional<ttype> cache_; </s> remove T& dereference() const { return *static_cast<T*>(e_->elements[accessor_->id_].ptr); </s> add const T& dereference() const { return *static_cast<T*>( e_->getThreadEntry()->elements[accessor_->id_].ptr); } T& dereference() { return *static_cast<T*>( e_->getThreadEntry()->elements[accessor_->id_].ptr); </s> remove void increment() { node_ = node_->next(); }; bool equal(const csl_iterator& other) const { return node_ == other.node_; } value_type& dereference() const { return node_->data(); } </s> add void increment() { node_ = node_->next(); } bool equal(const csl_iterator& other) const { return node_ == other.node_; } value_type& dereference() const { return node_->data(); }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep keep keep replace replace replace keep keep keep keep replace replace keep keep keep keep
<mask> return cache_; <mask> } <mask> <mask> public: <mask> explicit Transformer(const It& it) <mask> : Transformer::iterator_adaptor_(it), valid_(false) {} <mask> }; <mask> <mask> // conversion factory <mask> template <typename T, typename It> <mask> inline std::move_iterator<Transformer<T, It>> <mask> conversionIterator(const It& it) { <mask> return std::make_move_iterator(Transformer<T, It>(it)); <mask> } <mask> <mask> } // namespace dynamicconverter_detail </s> [sdk33] Update iOS with RN 0.59 </s> remove return cache_; </s> add return cache_.value(); </s> remove static inline void derefToCache(T* mem, const dynamic::const_iterator& it) { new (mem) T(convertTo<T>(*it)); </s> add static inline void derefToCache( Optional<T>* mem, const dynamic::const_iterator& it) { mem->emplace(convertTo<T>(*it)); </s> remove static inline void derefToCache(std::pair<F, S>* mem, const dynamic::const_item_iterator& it) { new (mem) std::pair<F, S>( convertTo<F>(it->first), convertTo<S>(it->second) ); </s> add static inline void derefToCache( Optional<std::pair<F, S>>* mem, const dynamic::const_item_iterator& it) { mem->emplace(convertTo<F>(it->first), convertTo<S>(it->second)); </s> remove class Transformer : public boost::iterator_adaptor< Transformer<T, It>, It, typename T::value_type > { </s> add class Transformer : public boost:: iterator_adaptor<Transformer<T, It>, It, typename T::value_type> { </s> remove } // namespace folly </s> add namespace threadlocal_detail { template <typename> struct static_meta_of; template <typename T, typename Tag, typename AccessMode> struct static_meta_of<ThreadLocalPtr<T, Tag, AccessMode>> { using type = StaticMeta<Tag, AccessMode>; }; template <typename T, typename Tag, typename AccessMode> struct static_meta_of<ThreadLocal<T, Tag, AccessMode>> { using type = StaticMeta<Tag, AccessMode>; }; } // namespace threadlocal_detail } // namespace folly
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep keep keep keep replace keep keep keep keep keep
<mask> * 'static T convert(const dynamic&);' <mask> */ <mask> <mask> // default - intentionally unimplemented <mask> template <typename T, typename Enable = void> struct DynamicConverter; <mask> <mask> // boolean <mask> template <> <mask> struct DynamicConverter<bool> { <mask> static bool convert(const dynamic& d) { </s> [sdk33] Update iOS with RN 0.59 </s> remove struct DynamicConverter<T, </s> add struct DynamicConverter< T, </s> remove struct DynamicConverter<T, typename std::enable_if<std::is_enum<T>::value>::type> { </s> add struct DynamicConverter< T, typename std::enable_if<std::is_enum<T>::value>::type> { </s> remove struct DynamicConverter<T, typename std::enable_if<std::is_integral<T>::value && !std::is_same<T, bool>::value>::type> { </s> add struct DynamicConverter< T, typename std::enable_if< std::is_integral<T>::value && !std::is_same<T, bool>::value>::type> { </s> remove struct DynamicConverter<C, </s> add struct DynamicConverter< C, </s> remove // containers </s> add // non-associative containers </s> remove dynamicconverter_detail::is_container<C>::value>::type> { </s> add dynamicconverter_detail::is_container<C>::value && !dynamicconverter_detail::is_associative<C>::value>::type> {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> }; <mask> <mask> // integrals <mask> template <typename T> <mask> struct DynamicConverter<T, <mask> typename std::enable_if<std::is_integral<T>::value && <mask> !std::is_same<T, bool>::value>::type> { <mask> static T convert(const dynamic& d) { <mask> return folly::to<T>(d.asInt()); <mask> } <mask> }; <mask> </s> [sdk33] Update iOS with RN 0.59 </s> remove struct DynamicConverter<T, </s> add struct DynamicConverter< T, </s> remove struct DynamicConverter<T, typename std::enable_if<std::is_enum<T>::value>::type> { </s> add struct DynamicConverter< T, typename std::enable_if<std::is_enum<T>::value>::type> { </s> remove // containers </s> add // non-associative containers </s> remove struct DynamicConverter<C, </s> add struct DynamicConverter< C, </s> remove struct DynamicConverter<std::pair<F,S>> { </s> add struct DynamicConverter<std::pair<F, S>> { </s> remove template <typename T, typename Enable = void> struct DynamicConverter; </s> add template <typename T, typename Enable = void> struct DynamicConverter;
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep keep keep keep replace replace keep keep keep keep keep
<mask> }; <mask> <mask> // enums <mask> template <typename T> <mask> struct DynamicConverter<T, <mask> typename std::enable_if<std::is_enum<T>::value>::type> { <mask> static T convert(const dynamic& d) { <mask> using type = typename std::underlying_type<T>::type; <mask> return static_cast<T>(DynamicConverter<type>::convert(d)); <mask> } <mask> }; </s> [sdk33] Update iOS with RN 0.59 </s> remove struct DynamicConverter<T, </s> add struct DynamicConverter< T, </s> remove struct DynamicConverter<T, typename std::enable_if<std::is_integral<T>::value && !std::is_same<T, bool>::value>::type> { </s> add struct DynamicConverter< T, typename std::enable_if< std::is_integral<T>::value && !std::is_same<T, bool>::value>::type> { </s> remove // containers </s> add // non-associative containers </s> remove struct DynamicConverter<C, </s> add struct DynamicConverter< C, </s> remove template <typename T, typename Enable = void> struct DynamicConverter; </s> add template <typename T, typename Enable = void> struct DynamicConverter; </s> remove struct DynamicConverter<std::pair<F,S>> { </s> add struct DynamicConverter<std::pair<F, S>> {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep keep keep keep replace keep keep keep keep keep
<mask> }; <mask> <mask> // floating point <mask> template <typename T> <mask> struct DynamicConverter<T, <mask> typename std::enable_if<std::is_floating_point<T>::value>::type> { <mask> static T convert(const dynamic& d) { <mask> return folly::to<T>(d.asDouble()); <mask> } <mask> }; </s> [sdk33] Update iOS with RN 0.59 </s> remove struct DynamicConverter<T, typename std::enable_if<std::is_enum<T>::value>::type> { </s> add struct DynamicConverter< T, typename std::enable_if<std::is_enum<T>::value>::type> { </s> remove struct DynamicConverter<T, typename std::enable_if<std::is_integral<T>::value && !std::is_same<T, bool>::value>::type> { </s> add struct DynamicConverter< T, typename std::enable_if< std::is_integral<T>::value && !std::is_same<T, bool>::value>::type> { </s> remove // containers </s> add // non-associative containers </s> remove struct DynamicConverter<C, </s> add struct DynamicConverter< C, </s> remove template <typename T, typename Enable = void> struct DynamicConverter; </s> add template <typename T, typename Enable = void> struct DynamicConverter; </s> remove struct DynamicConverter<std::pair<F,S>> { </s> add struct DynamicConverter<std::pair<F, S>> {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep keep keep keep replace keep keep keep keep keep
<mask> }; <mask> <mask> // std::pair <mask> template <typename F, typename S> <mask> struct DynamicConverter<std::pair<F,S>> { <mask> static std::pair<F, S> convert(const dynamic& d) { <mask> if (d.isArray() && d.size() == 2) { <mask> return std::make_pair(convertTo<F>(d[0]), convertTo<S>(d[1])); <mask> } else if (d.isObject() && d.size() == 1) { <mask> auto it = d.items().begin(); </s> [sdk33] Update iOS with RN 0.59 </s> remove dynamicconverter_detail::is_container<C>::value>::type> { </s> add dynamicconverter_detail::is_container<C>::value && !dynamicconverter_detail::is_associative<C>::value>::type> { </s> remove struct DynamicConverter<T, typename std::enable_if<std::is_integral<T>::value && !std::is_same<T, bool>::value>::type> { </s> add struct DynamicConverter< T, typename std::enable_if< std::is_integral<T>::value && !std::is_same<T, bool>::value>::type> { </s> remove struct DynamicConverter<C, </s> add struct DynamicConverter< C, </s> remove struct DynamicConverter<T, </s> add struct DynamicConverter< T, </s> remove struct DynamicConverter<T, typename std::enable_if<std::is_enum<T>::value>::type> { </s> add struct DynamicConverter< T, typename std::enable_if<std::is_enum<T>::value>::type> { </s> remove // containers </s> add // non-associative containers
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep keep keep replace keep replace
<mask> } <mask> }; <mask> <mask> // containers <mask> template <typename C> <mask> struct DynamicConverter<C, </s> [sdk33] Update iOS with RN 0.59 </s> remove dynamicconverter_detail::is_container<C>::value>::type> { </s> add dynamicconverter_detail::is_container<C>::value && !dynamicconverter_detail::is_associative<C>::value>::type> { </s> add // identity template <typename C> struct DynamicConstructor< C, typename std::enable_if<std::is_same<C, dynamic>::value>::type> { static dynamic construct(const C& x) { return x; } }; </s> remove template<typename C> struct DynamicConstructor<C, </s> add template <typename C> struct DynamicConstructor< C, </s> remove template<typename C> struct DynamicConstructor<C, </s> add template <typename C> struct DynamicConstructor< C, </s> remove } // namespace folly </s> add namespace threadlocal_detail { template <typename> struct static_meta_of; template <typename T, typename Tag, typename AccessMode> struct static_meta_of<ThreadLocalPtr<T, Tag, AccessMode>> { using type = StaticMeta<Tag, AccessMode>; }; template <typename T, typename Tag, typename AccessMode> struct static_meta_of<ThreadLocal<T, Tag, AccessMode>> { using type = StaticMeta<Tag, AccessMode>; }; } // namespace threadlocal_detail } // namespace folly
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep keep keep keep replace keep keep replace replace keep
<mask> // containers <mask> template <typename C> <mask> struct DynamicConverter<C, <mask> typename std::enable_if< <mask> dynamicconverter_detail::is_container<C>::value>::type> { <mask> static C convert(const dynamic& d) { <mask> if (d.isArray()) { <mask> return C(dynamicconverter_detail::conversionIterator<C>(d.begin()), <mask> dynamicconverter_detail::conversionIterator<C>(d.end())); <mask> } else if (d.isObject()) { </s> [sdk33] Update iOS with RN 0.59 </s> remove struct DynamicConverter<C, </s> add struct DynamicConverter< C, </s> remove // containers </s> add // non-associative containers </s> remove return C(dynamicconverter_detail::conversionIterator<C> (d.items().begin()), dynamicconverter_detail::conversionIterator<C> (d.items().end())); </s> add return C( dynamicconverter_detail::conversionIterator<C>(d.items().begin()), dynamicconverter_detail::conversionIterator<C>(d.items().end())); </s> remove struct DynamicConverter<T, typename std::enable_if<std::is_integral<T>::value && !std::is_same<T, bool>::value>::type> { </s> add struct DynamicConverter< T, typename std::enable_if< std::is_integral<T>::value && !std::is_same<T, bool>::value>::type> { </s> remove struct DynamicConverter<std::pair<F,S>> { </s> add struct DynamicConverter<std::pair<F, S>> {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> if (d.isArray()) { <mask> return C(dynamicconverter_detail::conversionIterator<C>(d.begin()), <mask> dynamicconverter_detail::conversionIterator<C>(d.end())); <mask> } else if (d.isObject()) { <mask> return C(dynamicconverter_detail::conversionIterator<C> <mask> (d.items().begin()), <mask> dynamicconverter_detail::conversionIterator<C> <mask> (d.items().end())); <mask> } else { <mask> throw TypeError("object or array", d.type()); <mask> } <mask> } <mask> }; </s> [sdk33] Update iOS with RN 0.59 </s> remove return C(dynamicconverter_detail::conversionIterator<C>(d.begin()), dynamicconverter_detail::conversionIterator<C>(d.end())); </s> add return C( dynamicconverter_detail::conversionIterator<C>(d.begin()), dynamicconverter_detail::conversionIterator<C>(d.end())); </s> remove dynamicconverter_detail::is_container<C>::value>::type> { </s> add dynamicconverter_detail::is_container<C>::value && !dynamicconverter_detail::is_associative<C>::value>::type> { </s> remove if (c == '\r') output += 'r'; else if (c == '\n') output += 'n'; else if (c == '\t') output += 't'; else if (c == '\a') output += 'a'; else if (c == '\b') output += 'b'; else if (c == '\0') output += '0'; else if (c == '\\') output += '\\'; else { </s> add if (c == '\r') { output += 'r'; } else if (c == '\n') { output += 'n'; } else if (c == '\t') { output += 't'; } else if (c == '\a') { output += 'a'; } else if (c == '\b') { output += 'b'; } else if (c == '\0') { output += '0'; } else if (c == '\\') { output += '\\'; } else { </s> remove return [](T* v) { delete v; }; </s> add return [](T* v) { delete v; }; </s> remove TeardownFunc t) { </s> add TeardownFunc t) { </s> remove rv = value; </s> add rv = T(value);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep keep keep add keep keep keep keep keep keep
<mask> return dynamic(x); <mask> } <mask> }; <mask> <mask> // maps <mask> template <typename C> <mask> struct DynamicConstructor< <mask> C, <mask> typename std::enable_if< <mask> !std::is_same<C, dynamic>::value && </s> [sdk33] Update iOS with RN 0.59 </s> remove template<typename C> struct DynamicConstructor<C, </s> add template <typename C> struct DynamicConstructor< C, </s> remove template<typename C> struct DynamicConstructor<C, </s> add template <typename C> struct DynamicConstructor< C, </s> remove dynamicconverter_detail::is_map<C>::value>::type> { </s> add !std::is_same<C, dynamic>::value && dynamicconverter_detail::is_map<C>::value>::type> { </s> remove !dynamicconverter_detail::is_map<C>::value && !std::is_constructible<StringPiece, const C&>::value && dynamicconverter_detail::is_range<C>::value>::type> { </s> add !std::is_same<C, dynamic>::value && !dynamicconverter_detail::is_map<C>::value && !std::is_constructible<StringPiece, const C&>::value && dynamicconverter_detail::is_range<C>::value>::type> { </s> remove struct DynamicConverter<C, </s> add struct DynamicConverter< C, </s> remove // containers </s> add // non-associative containers
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep keep replace replace keep replace
<mask> <mask> // maps <mask> template<typename C> <mask> struct DynamicConstructor<C, <mask> typename std::enable_if< <mask> dynamicconverter_detail::is_map<C>::value>::type> { </s> [sdk33] Update iOS with RN 0.59 </s> remove template<typename C> struct DynamicConstructor<C, </s> add template <typename C> struct DynamicConstructor< C, </s> add // identity template <typename C> struct DynamicConstructor< C, typename std::enable_if<std::is_same<C, dynamic>::value>::type> { static dynamic construct(const C& x) { return x; } }; </s> remove !dynamicconverter_detail::is_map<C>::value && !std::is_constructible<StringPiece, const C&>::value && dynamicconverter_detail::is_range<C>::value>::type> { </s> add !std::is_same<C, dynamic>::value && !dynamicconverter_detail::is_map<C>::value && !std::is_constructible<StringPiece, const C&>::value && dynamicconverter_detail::is_range<C>::value>::type> { </s> remove struct DynamicConverter<C, </s> add struct DynamicConverter< C, </s> remove // containers </s> add // non-associative containers
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep keep keep keep replace keep keep keep keep keep
<mask> typename std::enable_if< <mask> dynamicconverter_detail::is_map<C>::value>::type> { <mask> static dynamic construct(const C& x) { <mask> dynamic d = dynamic::object; <mask> for (auto& pair : x) { <mask> d.insert(toDynamic(pair.first), toDynamic(pair.second)); <mask> } <mask> return d; <mask> } <mask> }; </s> [sdk33] Update iOS with RN 0.59 </s> remove dynamicconverter_detail::is_map<C>::value>::type> { </s> add !std::is_same<C, dynamic>::value && dynamicconverter_detail::is_map<C>::value>::type> { </s> remove template<typename C> struct DynamicConstructor<C, </s> add template <typename C> struct DynamicConstructor< C, </s> remove for (auto& item : x) { </s> add for (const auto& item : x) { </s> remove !dynamicconverter_detail::is_map<C>::value && !std::is_constructible<StringPiece, const C&>::value && dynamicconverter_detail::is_range<C>::value>::type> { </s> add !std::is_same<C, dynamic>::value && !dynamicconverter_detail::is_map<C>::value && !std::is_constructible<StringPiece, const C&>::value && dynamicconverter_detail::is_range<C>::value>::type> { </s> remove template<typename A, typename B> </s> add template <typename A, typename B> </s> add // vector<bool> template <> struct DynamicConstructor<std::vector<bool>, void> { static dynamic construct(const std::vector<bool>& x) { dynamic d = dynamic::array; // Intentionally specifying the type as bool here. // std::vector<bool>'s iterators return a proxy which is a prvalue // and hence cannot bind to an lvalue reference such as auto& for (bool item : x) { d.push_back(toDynamic(item)); } return d; } };
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep replace replace keep replace replace replace keep keep
<mask> // other ranges <mask> template<typename C> <mask> struct DynamicConstructor<C, <mask> typename std::enable_if< <mask> !dynamicconverter_detail::is_map<C>::value && <mask> !std::is_constructible<StringPiece, const C&>::value && <mask> dynamicconverter_detail::is_range<C>::value>::type> { <mask> static dynamic construct(const C& x) { <mask> dynamic d = dynamic::array; </s> [sdk33] Update iOS with RN 0.59 </s> remove for (auto& item : x) { </s> add for (const auto& item : x) { </s> remove dynamicconverter_detail::is_map<C>::value>::type> { </s> add !std::is_same<C, dynamic>::value && dynamicconverter_detail::is_map<C>::value>::type> { </s> remove template<typename C> struct DynamicConstructor<C, </s> add template <typename C> struct DynamicConstructor< C, </s> remove template<typename A, typename B> </s> add template <typename A, typename B> </s> add // identity template <typename C> struct DynamicConstructor< C, typename std::enable_if<std::is_same<C, dynamic>::value>::type> { static dynamic construct(const C& x) { return x; } };
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep keep keep keep replace keep keep keep keep keep
<mask> !std::is_constructible<StringPiece, const C&>::value && <mask> dynamicconverter_detail::is_range<C>::value>::type> { <mask> static dynamic construct(const C& x) { <mask> dynamic d = dynamic::array; <mask> for (auto& item : x) { <mask> d.push_back(toDynamic(item)); <mask> } <mask> return d; <mask> } <mask> }; </s> [sdk33] Update iOS with RN 0.59 </s> remove !dynamicconverter_detail::is_map<C>::value && !std::is_constructible<StringPiece, const C&>::value && dynamicconverter_detail::is_range<C>::value>::type> { </s> add !std::is_same<C, dynamic>::value && !dynamicconverter_detail::is_map<C>::value && !std::is_constructible<StringPiece, const C&>::value && dynamicconverter_detail::is_range<C>::value>::type> { </s> remove for (auto& pair : x) { </s> add for (const auto& pair : x) { </s> remove template<typename C> struct DynamicConstructor<C, </s> add template <typename C> struct DynamicConstructor< C, </s> remove dynamicconverter_detail::is_map<C>::value>::type> { </s> add !std::is_same<C, dynamic>::value && dynamicconverter_detail::is_map<C>::value>::type> { </s> add // vector<bool> template <> struct DynamicConstructor<std::vector<bool>, void> { static dynamic construct(const std::vector<bool>& x) { dynamic d = dynamic::array; // Intentionally specifying the type as bool here. // std::vector<bool>'s iterators return a proxy which is a prvalue // and hence cannot bind to an lvalue reference such as auto& for (bool item : x) { d.push_back(toDynamic(item)); } return d; } }; </s> remove template<typename C> struct DynamicConstructor<C, </s> add template <typename C> struct DynamicConstructor< C,
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> }; <mask> <mask> // pair <mask> template<typename A, typename B> <mask> struct DynamicConstructor<std::pair<A, B>, void> { <mask> static dynamic construct(const std::pair<A, B>& x) { <mask> dynamic d = dynamic::array; <mask> d.push_back(toDynamic(x.first)); <mask> d.push_back(toDynamic(x.second)); </s> [sdk33] Update iOS with RN 0.59 </s> remove template<typename C> struct DynamicConstructor<C, </s> add template <typename C> struct DynamicConstructor< C, </s> remove dynamicconverter_detail::is_map<C>::value>::type> { </s> add !std::is_same<C, dynamic>::value && dynamicconverter_detail::is_map<C>::value>::type> { </s> remove for (auto& pair : x) { </s> add for (const auto& pair : x) { </s> remove !dynamicconverter_detail::is_map<C>::value && !std::is_constructible<StringPiece, const C&>::value && dynamicconverter_detail::is_range<C>::value>::type> { </s> add !std::is_same<C, dynamic>::value && !dynamicconverter_detail::is_map<C>::value && !std::is_constructible<StringPiece, const C&>::value && dynamicconverter_detail::is_range<C>::value>::type> { </s> remove for (auto& item : x) { </s> add for (const auto& item : x) { </s> add // vector<bool> template <> struct DynamicConstructor<std::vector<bool>, void> { static dynamic construct(const std::vector<bool>& x) { dynamic d = dynamic::array; // Intentionally specifying the type as bool here. // std::vector<bool>'s iterators return a proxy which is a prvalue // and hence cannot bind to an lvalue reference such as auto& for (bool item : x) { d.push_back(toDynamic(item)); } return d; } };
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep keep keep add keep keep keep keep keep
<mask> return d; <mask> } <mask> }; <mask> <mask> /////////////////////////////////////////////////////////////////////////////// <mask> // implementation <mask> <mask> template <typename T> <mask> T convertTo(const dynamic& d) { </s> [sdk33] Update iOS with RN 0.59 </s> remove template<typename T> </s> add template <typename T> </s> remove struct DynamicConverter<T, </s> add struct DynamicConverter< T, </s> remove struct DynamicConverter<T, typename std::enable_if<std::is_enum<T>::value>::type> { </s> add struct DynamicConverter< T, typename std::enable_if<std::is_enum<T>::value>::type> { </s> remove struct DynamicConverter<T, typename std::enable_if<std::is_integral<T>::value && !std::is_same<T, bool>::value>::type> { </s> add struct DynamicConverter< T, typename std::enable_if< std::is_integral<T>::value && !std::is_same<T, bool>::value>::type> { </s> remove // containers </s> add // non-associative containers </s> remove struct DynamicConverter<C, </s> add struct DynamicConverter< C,
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep keep keep keep replace keep keep keep keep keep
<mask> T convertTo(const dynamic& d) { <mask> return DynamicConverter<typename std::remove_cv<T>::type>::convert(d); <mask> } <mask> <mask> template<typename T> <mask> dynamic toDynamic(const T& x) { <mask> return DynamicConstructor<typename std::remove_cv<T>::type>::construct(x); <mask> } <mask> <mask> } // namespace folly </s> [sdk33] Update iOS with RN 0.59 </s> add // vector<bool> template <> struct DynamicConstructor<std::vector<bool>, void> { static dynamic construct(const std::vector<bool>& x) { dynamic d = dynamic::array; // Intentionally specifying the type as bool here. // std::vector<bool>'s iterators return a proxy which is a prvalue // and hence cannot bind to an lvalue reference such as auto& for (bool item : x) { d.push_back(toDynamic(item)); } return d; } }; </s> remove struct DynamicConverter<T, </s> add struct DynamicConverter< T, </s> remove struct DynamicConverter<T, typename std::enable_if<std::is_enum<T>::value>::type> { </s> add struct DynamicConverter< T, typename std::enable_if<std::is_enum<T>::value>::type> { </s> remove struct DynamicConverter<T, typename std::enable_if<std::is_integral<T>::value && !std::is_same<T, bool>::value>::type> { </s> add struct DynamicConverter< T, typename std::enable_if< std::is_integral<T>::value && !std::is_same<T, bool>::value>::type> { </s> remove dynamicconverter_detail::is_map<C>::value>::type> { </s> add !std::is_same<C, dynamic>::value && dynamicconverter_detail::is_map<C>::value>::type> { </s> remove template<typename C> struct DynamicConstructor<C, </s> add template <typename C> struct DynamicConstructor< C,
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/DynamicConverter.h
keep replace keep keep keep keep keep
<mask> /* <mask> * Copyright 2016 Facebook, Inc. <mask> * <mask> * Licensed under the Apache License, Version 2.0 (the "License"); <mask> * you may not use this file except in compliance with the License. <mask> * You may obtain a copy of the License at <mask> * </s> [sdk33] Update iOS with RN 0.59
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/Exception.h
keep replace keep keep keep keep replace replace keep keep keep keep
<mask> [[noreturn]] inline void throwSystemErrorExplicit(int err, const char* msg) { <mask> throw std::system_error(err, std::system_category(), msg); <mask> } <mask> <mask> template <class... Args> <mask> [[noreturn]] void throwSystemErrorExplicit(int err, Args&&... args) { <mask> throwSystemErrorExplicit( <mask> err, to<fbstring>(std::forward<Args>(args)...).c_str()); <mask> } <mask> <mask> // Helper to throw std::system_error from errno and components of a string <mask> template <class... Args> </s> [sdk33] Update iOS with RN 0.59 </s> remove throwSystemErrorExplicit(-ret, std::forward<Args>(args)...); </s> add throwSystemErrorExplicit(int(-ret), std::forward<Args>(args)...); </s> remove throw BadFormatArg(errorStr(std::forward<Args>(args)...)); </s> add throw_exception<BadFormatArg>(errorStr(std::forward<Args>(args)...)); </s> remove "invalid format argument {", fullArgString, "}: ", std::forward<Args>(args)...); </s> add "invalid format argument {", fullArgString, "}: ", std::forward<Args>(args)...); </s> remove template<class ...Args> </s> add template <class... Args> </s> remove static void enforce( bool condition, void (*throw_exc)(const char*), const char* msg) { </s> add template <typename Ex, typename... Args> FOLLY_ALWAYS_INLINE static void enforce(bool condition, Args&&... args) {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/Exception.h
keep keep keep keep replace keep keep keep keep keep
<mask> // number on error), throw on error. <mask> template <class... Args> <mask> void checkKernelError(ssize_t ret, Args&&... args) { <mask> if (UNLIKELY(ret < 0)) { <mask> throwSystemErrorExplicit(-ret, std::forward<Args>(args)...); <mask> } <mask> } <mask> <mask> // Check a traditional Unix return code (-1 and sets errno on error), throw <mask> // on error. </s> [sdk33] Update iOS with RN 0.59 </s> remove throwSystemErrorExplicit( err, to<fbstring>(std::forward<Args>(args)...).c_str()); </s> add throw makeSystemErrorExplicit(err, std::forward<Args>(args)...); </s> remove throw std::system_error(err, std::system_category(), msg); </s> add throw makeSystemErrorExplicit(err, msg); </s> remove OTHER </s> add OTHER, </s> remove "invalid format argument {", fullArgString, "}: ", std::forward<Args>(args)...); </s> add "invalid format argument {", fullArgString, "}: ", std::forward<Args>(args)...); </s> remove template <typename E, typename V, typename... Args> void throwOnFail(V&& value, Args&&... args) { if (!value) { throw E(std::forward<Args>(args)...); } } </s> add </s> remove template <class SynchronizedType, class LockPolicy> class LockedGuardPtr { private: // CDataType is the DataType with the appropriate const-qualification using CDataType = detail::SynchronizedDataType<SynchronizedType>; public: using DataType = typename SynchronizedType::DataType; using MutexType = typename SynchronizedType::MutexType; using Synchronized = typename std::remove_const<SynchronizedType>::type; LockedGuardPtr() = delete; /** * Takes a Synchronized<T> and locks it. */ explicit LockedGuardPtr(SynchronizedType* parent) : parent_(parent) { LockPolicy::lock(parent_->mutex_); } /** * Destructor releases. */ ~LockedGuardPtr() { LockPolicy::unlock(parent_->mutex_); } /** * Access the locked data. */ CDataType* operator->() const { return &parent_->datum_; } </s> add template <typename D, typename M, typename... Args> auto wlock(Synchronized<D, M>& synchronized, Args&&... args) { return detail::wlock(synchronized, std::forward<Args>(args)...); } template <typename Data, typename Mutex, typename... Args> auto rlock(const Synchronized<Data, Mutex>& synchronized, Args&&... args) { return detail::rlock(synchronized, std::forward<Args>(args)...); } template <typename D, typename M, typename... Args> auto ulock(Synchronized<D, M>& synchronized, Args&&... args) { return detail::ulock(synchronized, std::forward<Args>(args)...); } template <typename D, typename M, typename... Args> auto lock(Synchronized<D, M>& synchronized, Args&&... args) { return detail::lock(synchronized, std::forward<Args>(args)...); } template <typename D, typename M, typename... Args> auto lock(const Synchronized<D, M>& synchronized, Args&&... args) { return detail::lock(synchronized, std::forward<Args>(args)...); }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/Exception.h
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep replace replace replace replace
<mask> throwSystemErrorExplicit(savedErrno, std::forward<Args>(args)...); <mask> } <mask> } <mask> <mask> template <typename E, typename V, typename... Args> <mask> void throwOnFail(V&& value, Args&&... args) { <mask> if (!value) { <mask> throw E(std::forward<Args>(args)...); <mask> } <mask> } <mask> <mask> /** <mask> * If cond is not true, raise an exception of type E. E must have a ctor that <mask> * works with const char* (a description of the failure). <mask> */ <mask> #define CHECK_THROW(cond, E) \ <mask> ::folly::throwOnFail<E>((cond), "Check failed: " #cond) <mask> <mask> } // namespace folly </s> [sdk33] Update iOS with RN 0.59 </s> remove template <class SynchronizedType, class LockPolicy> class LockedGuardPtr { private: // CDataType is the DataType with the appropriate const-qualification using CDataType = detail::SynchronizedDataType<SynchronizedType>; public: using DataType = typename SynchronizedType::DataType; using MutexType = typename SynchronizedType::MutexType; using Synchronized = typename std::remove_const<SynchronizedType>::type; LockedGuardPtr() = delete; /** * Takes a Synchronized<T> and locks it. */ explicit LockedGuardPtr(SynchronizedType* parent) : parent_(parent) { LockPolicy::lock(parent_->mutex_); } /** * Destructor releases. */ ~LockedGuardPtr() { LockPolicy::unlock(parent_->mutex_); } /** * Access the locked data. */ CDataType* operator->() const { return &parent_->datum_; } </s> add template <typename D, typename M, typename... Args> auto wlock(Synchronized<D, M>& synchronized, Args&&... args) { return detail::wlock(synchronized, std::forward<Args>(args)...); } template <typename Data, typename Mutex, typename... Args> auto rlock(const Synchronized<Data, Mutex>& synchronized, Args&&... args) { return detail::rlock(synchronized, std::forward<Args>(args)...); } template <typename D, typename M, typename... Args> auto ulock(Synchronized<D, M>& synchronized, Args&&... args) { return detail::ulock(synchronized, std::forward<Args>(args)...); } template <typename D, typename M, typename... Args> auto lock(Synchronized<D, M>& synchronized, Args&&... args) { return detail::lock(synchronized, std::forward<Args>(args)...); } template <typename D, typename M, typename... Args> auto lock(const Synchronized<D, M>& synchronized, Args&&... args) { return detail::lock(synchronized, std::forward<Args>(args)...); } </s> remove throwSystemErrorExplicit( err, to<fbstring>(std::forward<Args>(args)...).c_str()); </s> add throw makeSystemErrorExplicit(err, std::forward<Args>(args)...); </s> remove // Invoke helper template <typename F, typename... Args> inline auto invoke(F&& f, Args&&... args) -> decltype(std::forward<F>(f)(std::forward<Args>(args)...)) { return std::forward<F>(f)(std::forward<Args>(args)...); } template <typename M, typename C, typename... Args> inline auto invoke(M(C::*d), Args&&... args) -> decltype(std::mem_fn(d)(std::forward<Args>(args)...)) { return std::mem_fn(d)(std::forward<Args>(args)...); } </s> add </s> remove throwSystemErrorExplicit(-ret, std::forward<Args>(args)...); </s> add throwSystemErrorExplicit(int(-ret), std::forward<Args>(args)...); </s> remove } // detail </s> add template < typename Synchronized, typename LockFunc, typename TryLockFunc, typename... Args> class SynchronizedLocker { public: using LockedPtr = invoke_result_t<LockFunc&, Synchronized&, const Args&...>; template <typename LockFuncType, typename TryLockFuncType, typename... As> SynchronizedLocker( Synchronized& sync, LockFuncType&& lockFunc, TryLockFuncType tryLockFunc, As&&... as) : synchronized{sync}, lockFunc_{std::forward<LockFuncType>(lockFunc)}, tryLockFunc_{std::forward<TryLockFuncType>(tryLockFunc)}, args_{std::forward<As>(as)...} {} auto lock() const { auto args = std::tuple<const Args&...>{args_}; return apply(lockFunc_, std::tuple_cat(std::tie(synchronized), args)); } auto tryLock() const { return tryLockFunc_(synchronized); } private: Synchronized& synchronized; LockFunc lockFunc_; TryLockFunc tryLockFunc_; std::tuple<Args...> args_; }; template < typename Synchronized, typename LockFunc, typename TryLockFunc, typename... Args> auto makeSynchronizedLocker( Synchronized& synchronized, LockFunc&& lockFunc, TryLockFunc&& tryLockFunc, Args&&... args) { using LockFuncType = std::decay_t<LockFunc>; using TryLockFuncType = std::decay_t<TryLockFunc>; return SynchronizedLocker< Synchronized, LockFuncType, TryLockFuncType, std::decay_t<Args>...>{synchronized, std::forward<LockFunc>(lockFunc), std::forward<TryLockFunc>(tryLockFunc), std::forward<Args>(args)...}; } /** * Acquire locks for multiple Synchronized<T> objects, in a deadlock-safe * manner. * * The function uses the "smart and polite" algorithm from this link * http://howardhinnant.github.io/dining_philosophers.html#Polite * * The gist of the algorithm is that it locks a mutex, then tries to lock the * other mutexes in a non-blocking manner. If all the locks succeed, we are * done, if not, we release the locks we have held, yield to allow other * threads to continue and then block on the mutex that we failed to acquire. * * This allows dynamically yielding ownership of all the mutexes but one, so * that other threads can continue doing work and locking the other mutexes. * See the benchmarks in folly/test/SynchronizedBenchmark.cpp for more. */ template <typename... SynchronizedLocker> auto lock(SynchronizedLocker... lockersIn) -> std::tuple<typename SynchronizedLocker::LockedPtr...> { // capture the list of lockers as a tuple auto lockers = std::forward_as_tuple(lockersIn...); // make a list of null LockedPtr instances that we will return to the caller auto lockedPtrs = std::tuple<typename SynchronizedLocker::LockedPtr...>{}; // start by locking the first thing in the list std::get<0>(lockedPtrs) = std::get<0>(lockers).lock(); auto indexLocked = 0; while (true) { auto couldLockAll = true; for_each(lockers, [&](auto& locker, auto index) { // if we should try_lock on the current locker then do so if (index != indexLocked) { auto lockedPtr = locker.tryLock(); // if we were unable to lock this mutex, // // 1. release all the locks, // 2. yield control to another thread to be nice // 3. block on the mutex we failed to lock, acquire the lock // 4. break out and set the index of the current mutex to indicate // which mutex we have locked if (!lockedPtr) { // writing lockedPtrs = decltype(lockedPtrs){} does not compile on // gcc, I believe this is a bug D7676798 lockedPtrs = std::tuple<typename SynchronizedLocker::LockedPtr...>{}; std::this_thread::yield(); fetch(lockedPtrs, index) = locker.lock(); indexLocked = index; couldLockAll = false; return loop_break; } // else store the locked mutex in the list we return fetch(lockedPtrs, index) = std::move(lockedPtr); } return loop_continue; }); if (couldLockAll) { return lockedPtrs; } } } template <typename Synchronized, typename... Args> auto wlock(Synchronized& synchronized, Args&&... args) { return detail::makeSynchronizedLocker( synchronized, [](auto& s, auto&&... a) { return s.wlock(std::forward<decltype(a)>(a)...); }, [](auto& s) { return s.tryWLock(); }, std::forward<Args>(args)...); } template <typename Synchronized, typename... Args> auto rlock(Synchronized& synchronized, Args&&... args) { return detail::makeSynchronizedLocker( synchronized, [](auto& s, auto&&... a) { return s.rlock(std::forward<decltype(a)>(a)...); }, [](auto& s) { return s.tryRLock(); }, std::forward<Args>(args)...); } template <typename Synchronized, typename... Args> auto ulock(Synchronized& synchronized, Args&&... args) { return detail::makeSynchronizedLocker( synchronized, [](auto& s, auto&&... a) { return s.ulock(std::forward<decltype(a)>(a)...); }, [](auto& s) { return s.tryULock(); }, std::forward<Args>(args)...); } template <typename Synchronized, typename... Args> auto lock(Synchronized& synchronized, Args&&... args) { return detail::makeSynchronizedLocker( synchronized, [](auto& s, auto&&... a) { return s.lock(std::forward<decltype(a)>(a)...); }, [](auto& s) { return s.tryLock(); }, std::forward<Args>(args)...); } } // namespace detail
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/Exception.h
keep replace keep keep keep keep keep
<mask> /* <mask> * Copyright 2016 Facebook, Inc. <mask> * <mask> * Licensed under the Apache License, Version 2.0 (the "License"); <mask> * you may not use this file except in compliance with the License. <mask> * You may obtain a copy of the License at <mask> * </s> [sdk33] Update iOS with RN 0.59
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/ExceptionString.h
keep keep keep keep replace keep keep keep keep
<mask> enable_if<!std::is_base_of<std::exception, E>::value, fbstring>::type { <mask> #ifdef FOLLY_HAS_RTTI <mask> return demangle(typeid(e)); <mask> #else <mask> return "Exception (no RTTI available)"; <mask> #endif <mask> } <mask> <mask> } // namespace folly </s> [sdk33] Update iOS with RN 0.59 </s> remove } } </s> add } // namespace portability } // namespace folly </s> remove } } } </s> add } // namespace sockets } // namespace portability } // namespace folly </s> remove } </s> add } // namespace folly </s> remove } </s> add } // namespace google </s> remove } </s> add } // namespace folly </s> remove void* aligned_malloc(size_t size, size_t align); void aligned_free(void* aligned_ptr); } } </s> add using folly::aligned_free; using folly::aligned_malloc; } // namespace detail } // namespace folly
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/ExceptionString.h
keep replace keep keep keep keep keep
<mask> /* <mask> * Copyright 2016 Facebook, Inc. <mask> * <mask> * Licensed under the Apache License, Version 2.0 (the "License"); <mask> * you may not use this file except in compliance with the License. <mask> * You may obtain a copy of the License at <mask> * </s> [sdk33] Update iOS with RN 0.59
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/ExceptionWrapper.h
keep keep keep add keep keep keep keep
<mask> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <mask> * See the License for the specific language governing permissions and <mask> * limitations under the License. <mask> */ <mask> <mask> #pragma once <mask> <mask> #include <cassert> </s> [sdk33] Update iOS with RN 0.59 </s> remove * </s> add */ /* * @author Eric Niebler ([email protected]), Sven Over ([email protected]) </s> remove #include <stdexcept> #include <cstdlib> #include <type_traits> </s> add </s> add #include <cassert> </s> add #include <cstdint> </s> remove #include <iostream> </s> add #include <iosfwd> </s> remove #include <folly/detail/CachelinePaddedImpl.h> </s> add #include <cstddef> #include <utility> #include <folly/lang/Align.h>
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/ExceptionWrapper.h
keep keep keep add keep keep keep keep keep
<mask> <mask> #pragma once <mask> <mask> #include <cassert> <mask> #include <exception> <mask> #include <iosfwd> <mask> #include <memory> <mask> #include <new> <mask> #include <type_traits> </s> [sdk33] Update iOS with RN 0.59 </s> remove #include <iostream> </s> add #include <iosfwd> </s> add #include <new> #include <type_traits> #include <typeinfo> #include <utility> #include <folly/CPortability.h> #include <folly/Demangle.h> </s> add #include <cassert> </s> remove #include <stdexcept> #include <cstdlib> #include <type_traits> </s> add </s> remove #include <memory> </s> add #include <functional> </s> remove #include <boost/iterator/iterator_facade.hpp> </s> add #include <iterator> #include <type_traits> #include <utility>
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/ExceptionWrapper.h
keep keep keep keep replace keep keep keep keep keep
<mask> #pragma once <mask> <mask> #include <cassert> <mask> #include <exception> <mask> #include <iostream> <mask> #include <memory> <mask> #include <folly/ExceptionString.h> <mask> #include <folly/detail/ExceptionWrapper.h> <mask> <mask> namespace folly { </s> [sdk33] Update iOS with RN 0.59 </s> remove #include <folly/detail/ExceptionWrapper.h> </s> add #include <folly/FBString.h> #include <folly/Portability.h> #include <folly/Traits.h> #include <folly/Utility.h> #include <folly/lang/Assume.h> #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpragmas" #pragma GCC diagnostic ignored "-Wpotentially-evaluated-expression" // GCC gets confused about lambda scopes and issues shadow-local warnings for // parameters in totally different functions. FOLLY_GCC_DISABLE_NEW_SHADOW_WARNINGS #endif #define FOLLY_EXCEPTION_WRAPPER_H_INCLUDED </s> add #include <cstdint> </s> add #include <new> #include <type_traits> #include <typeinfo> #include <utility> #include <folly/CPortability.h> #include <folly/Demangle.h> </s> remove #include <boost/multi_index_container.hpp> </s> add </s> add #include <folly/CPortability.h> </s> remove #include <string> </s> add
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/ExceptionWrapper.h
keep keep add keep keep keep keep keep keep
<mask> #include <exception> <mask> #include <iosfwd> <mask> #include <memory> <mask> #include <folly/ExceptionString.h> <mask> #include <folly/FBString.h> <mask> #include <folly/Portability.h> <mask> #include <folly/Traits.h> <mask> #include <folly/Utility.h> <mask> #include <folly/lang/Assume.h> </s> [sdk33] Update iOS with RN 0.59 </s> remove #include <folly/detail/ExceptionWrapper.h> </s> add #include <folly/FBString.h> #include <folly/Portability.h> #include <folly/Traits.h> #include <folly/Utility.h> #include <folly/lang/Assume.h> #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpragmas" #pragma GCC diagnostic ignored "-Wpotentially-evaluated-expression" // GCC gets confused about lambda scopes and issues shadow-local warnings for // parameters in totally different functions. FOLLY_GCC_DISABLE_NEW_SHADOW_WARNINGS #endif #define FOLLY_EXCEPTION_WRAPPER_H_INCLUDED </s> remove #include <iostream> </s> add #include <iosfwd> </s> add #include <cstdint> </s> remove #include <vector> #include <boost/type_traits.hpp> #include <boost/regex/pending/unicode_iterator.hpp> #ifdef FOLLY_HAVE_DEPRECATED_ASSOC #ifdef _GLIBCXX_SYMVER #include <ext/hash_set> #include <ext/hash_map> #endif #endif #include <unordered_set> </s> add </s> remove #include <folly/SmallLocks.h> #include <folly/portability/BitsFunctexcept.h> #include <folly/portability/Constexpr.h> </s> add #include <folly/Traits.h> #include <folly/lang/Assume.h> #include <folly/lang/Exception.h> #include <folly/memory/Malloc.h> </s> add #include <unordered_set> #include <vector>
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/ExceptionWrapper.h
keep keep keep replace keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep
<mask> #include <iostream> <mask> #include <memory> <mask> #include <folly/ExceptionString.h> <mask> #include <folly/detail/ExceptionWrapper.h> <mask> <mask> namespace folly { <mask> <mask> /* <mask> * Throwing exceptions can be a convenient way to handle errors. Storing <mask> * exceptions in an exception_ptr makes it easy to handle exceptions in a <mask> * different thread or at a later time. exception_ptr can also be used in a very <mask> * generic result/exception wrapper. <mask> * <mask> * However, there are some issues with throwing exceptions and <mask> * std::exception_ptr. These issues revolve around throw being expensive, <mask> * particularly in a multithreaded environment (see <mask> * ExceptionWrapperBenchmark.cpp). <mask> * <mask> * Imagine we have a library that has an API which returns a result/exception <mask> * wrapper. Let's consider some approaches for implementing this wrapper. <mask> * First, we could store a std::exception. This approach loses the derived <mask> * exception type, which can make exception handling more difficult for users <mask> * that prefer rethrowing the exception. We could use a folly::dynamic for every <mask> * possible type of exception. This is not very flexible - adding new types of <mask> * exceptions requires a change to the result/exception wrapper. We could use an <mask> * exception_ptr. However, constructing an exception_ptr as well as accessing <mask> * the error requires a call to throw. That means that there will be two calls <mask> * to throw in order to process the exception. For performance sensitive <mask> * applications, this may be unacceptable. <mask> * <mask> * exception_wrapper is designed to handle exception management for both <mask> * convenience and high performance use cases. make_exception_wrapper is <mask> * templated on derived type, allowing us to rethrow the exception properly for <mask> * users that prefer convenience. These explicitly named exception types can <mask> * therefore be handled without any peformance penalty. exception_wrapper is <mask> * also flexible enough to accept any type. If a caught exception is not of an <mask> * explicitly named type, then std::exception_ptr is used to preserve the <mask> * exception state. For performance sensitive applications, the accessor methods <mask> * can test or extract a pointer to a specific exception type with very little <mask> * overhead. <mask> * <mask> * Example usage: <mask> * <mask> * exception_wrapper globalExceptionWrapper; <mask> * <mask> * // Thread1 <mask> * void doSomethingCrazy() { <mask> * int rc = doSomethingCrazyWithLameReturnCodes(); <mask> * if (rc == NAILED_IT) { <mask> * globalExceptionWrapper = exception_wrapper(); <mask> * } else if (rc == FACE_PLANT) { <mask> * globalExceptionWrapper = make_exception_wrapper<FacePlantException>(); <mask> * } else if (rc == FAIL_WHALE) { <mask> * globalExceptionWrapper = make_exception_wrapper<FailWhaleException>(); <mask> * } <mask> * } <mask> * <mask> * // Thread2: Exceptions are ok! <mask> * void processResult() { <mask> * try { <mask> * globalExceptionWrapper.throwException(); <mask> * } catch (const FacePlantException& e) { <mask> * LOG(ERROR) << "FACEPLANT!"; <mask> * } catch (const FailWhaleException& e) { <mask> * LOG(ERROR) << "FAILWHALE!"; <mask> * } <mask> * } <mask> * <mask> * // Thread2: Exceptions are bad! <mask> * void processResult() { <mask> * globalExceptionWrapper.with_exception( <mask> * [&](FacePlantException& faceplant) { <mask> * LOG(ERROR) << "FACEPLANT"; <mask> * }) || <mask> * globalExceptionWrapper.with_exception( <mask> * [&](FailWhaleException& failwhale) { <mask> * LOG(ERROR) << "FAILWHALE!"; <mask> * }) || <mask> * LOG(FATAL) << "Unrecognized exception"; <mask> * } <mask> * <mask> */ <mask> class exception_wrapper { <mask> protected: <mask> template <typename Ex> <mask> struct optimize; <mask> <mask> public: </s> [sdk33] Update iOS with RN 0.59
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/ExceptionWrapper.h
keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep
<mask> struct optimize; <mask> <mask> public: <mask> exception_wrapper() = default; <mask> <mask> // Implicitly construct an exception_wrapper from a qualifying exception. <mask> // See the optimize struct for details. <mask> template <typename Ex, typename = <mask> typename std::enable_if<optimize<typename std::decay<Ex>::type>::value> <mask> ::type> <mask> /* implicit */ exception_wrapper(Ex&& exn) { <mask> typedef typename std::decay<Ex>::type DEx; <mask> item_ = std::make_shared<DEx>(std::forward<Ex>(exn)); <mask> throwfn_ = folly::detail::Thrower<DEx>::doThrow; <mask> } <mask> <mask> // The following two constructors are meant to emulate the behavior of <mask> // try_and_catch in performance sensitive code as well as to be flexible <mask> // enough to wrap exceptions of unknown type. There is an overload that <mask> // takes an exception reference so that the wrapper can extract and store <mask> // the exception's type and what() when possible. <mask> // <mask> // The canonical use case is to construct an all-catching exception wrapper <mask> // with minimal overhead like so: <mask> // <mask> // try { <mask> // // some throwing code <mask> // } catch (const std::exception& e) { <mask> // // won't lose e's type and what() <mask> // exception_wrapper ew{std::current_exception(), e}; <mask> // } catch (...) { <mask> // // everything else <mask> // exception_wrapper ew{std::current_exception()}; <mask> // } <mask> // <mask> // try_and_catch is cleaner and preferable. Use it unless you're sure you need <mask> // something like this instead. <mask> template <typename Ex> <mask> explicit exception_wrapper(std::exception_ptr eptr, Ex& exn) { <mask> assign_eptr(eptr, exn); <mask> } <mask> <mask> explicit exception_wrapper(std::exception_ptr eptr) { <mask> assign_eptr(eptr); <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove explicit exception_wrapper(std::exception_ptr eptr) { assign_eptr(eptr); } </s> add template <template <class> class T, class... As> using AllOf = StrictConjunction<T<As>...>; </s> remove /* * Throwing exceptions can be a convenient way to handle errors. Storing * exceptions in an exception_ptr makes it easy to handle exceptions in a * different thread or at a later time. exception_ptr can also be used in a very * generic result/exception wrapper. * * However, there are some issues with throwing exceptions and * std::exception_ptr. These issues revolve around throw being expensive, * particularly in a multithreaded environment (see * ExceptionWrapperBenchmark.cpp). * * Imagine we have a library that has an API which returns a result/exception * wrapper. Let's consider some approaches for implementing this wrapper. * First, we could store a std::exception. This approach loses the derived * exception type, which can make exception handling more difficult for users * that prefer rethrowing the exception. We could use a folly::dynamic for every * possible type of exception. This is not very flexible - adding new types of * exceptions requires a change to the result/exception wrapper. We could use an * exception_ptr. However, constructing an exception_ptr as well as accessing * the error requires a call to throw. That means that there will be two calls * to throw in order to process the exception. For performance sensitive * applications, this may be unacceptable. * * exception_wrapper is designed to handle exception management for both * convenience and high performance use cases. make_exception_wrapper is * templated on derived type, allowing us to rethrow the exception properly for * users that prefer convenience. These explicitly named exception types can * therefore be handled without any peformance penalty. exception_wrapper is * also flexible enough to accept any type. If a caught exception is not of an * explicitly named type, then std::exception_ptr is used to preserve the * exception state. For performance sensitive applications, the accessor methods * can test or extract a pointer to a specific exception type with very little * overhead. * * Example usage: * * exception_wrapper globalExceptionWrapper; * * // Thread1 * void doSomethingCrazy() { * int rc = doSomethingCrazyWithLameReturnCodes(); * if (rc == NAILED_IT) { * globalExceptionWrapper = exception_wrapper(); * } else if (rc == FACE_PLANT) { * globalExceptionWrapper = make_exception_wrapper<FacePlantException>(); * } else if (rc == FAIL_WHALE) { * globalExceptionWrapper = make_exception_wrapper<FailWhaleException>(); * } * } * * // Thread2: Exceptions are ok! * void processResult() { * try { * globalExceptionWrapper.throwException(); * } catch (const FacePlantException& e) { * LOG(ERROR) << "FACEPLANT!"; * } catch (const FailWhaleException& e) { * LOG(ERROR) << "FAILWHALE!"; * } * } * * // Thread2: Exceptions are bad! * void processResult() { * globalExceptionWrapper.with_exception( * [&](FacePlantException& faceplant) { * LOG(ERROR) << "FACEPLANT"; * }) || * globalExceptionWrapper.with_exception( * [&](FailWhaleException& failwhale) { * LOG(ERROR) << "FAILWHALE!"; * }) || * LOG(FATAL) << "Unrecognized exception"; * } * */ class exception_wrapper { protected: template <typename Ex> struct optimize; </s> add #define FOLLY_REQUIRES_DEF(...) \ _t<std::enable_if<static_cast<bool>(__VA_ARGS__), long>> </s> remove // If the exception_wrapper does not contain an exception, std::terminate() // is invoked to assure the [[noreturn]] behaviour. [[noreturn]] void throwException() const { if (throwfn_) { throwfn_(item_.get()); } else if (eptr_) { std::rethrow_exception(eptr_); } std::cerr << "Cannot use `throwException` with an empty folly::exception_wrapper" << std::endl; std::terminate(); } explicit operator bool() const { return item_ || eptr_; } </s> add template <bool If, class T> using AddConstIf = _t<std::conditional<If, const T, T>>; </s> remove // This will return a non-nullptr only if the exception is held as a // copy. It is the only interface which will distinguish between an // exception held this way, and by exception_ptr. You probably // shouldn't use it at all. std::exception* getCopied() { return item_.get(); } const std::exception* getCopied() const { return item_.get(); } fbstring what() const { if (item_) { return exceptionStr(*item_); } else if (eptr_) { return estr_; } else { return fbstring(); } } </s> add } // namespace exception_wrapper_detail //! Throwing exceptions can be a convenient way to handle errors. Storing //! exceptions in an `exception_ptr` makes it easy to handle exceptions in a //! different thread or at a later time. `exception_ptr` can also be used in a //! very generic result/exception wrapper. //! //! However, there are some issues with throwing exceptions and //! `std::exception_ptr`. These issues revolve around `throw` being expensive, //! particularly in a multithreaded environment (see //! ExceptionWrapperBenchmark.cpp). //! //! Imagine we have a library that has an API which returns a result/exception //! wrapper. Let's consider some approaches for implementing this wrapper. //! First, we could store a `std::exception`. This approach loses the derived //! exception type, which can make exception handling more difficult for users //! that prefer rethrowing the exception. We could use a `folly::dynamic` for //! every possible type of exception. This is not very flexible - adding new //! types of exceptions requires a change to the result/exception wrapper. We //! could use an `exception_ptr`. However, constructing an `exception_ptr` as //! well as accessing the error requires a call to throw. That means that there //! will be two calls to throw in order to process the exception. For //! performance sensitive applications, this may be unacceptable. //! //! `exception_wrapper` is designed to handle exception management for both //! convenience and high performance use cases. `make_exception_wrapper` is //! templated on derived type, allowing us to rethrow the exception properly for //! users that prefer convenience. These explicitly named exception types can //! therefore be handled without any peformance penalty. `exception_wrapper` is //! also flexible enough to accept any type. If a caught exception is not of an //! explicitly named type, then `std::exception_ptr` is used to preserve the //! exception state. For performance sensitive applications, the accessor //! methods can test or extract a pointer to a specific exception type with very //! little overhead. //! //! \par Example usage: //! \par //! \code //! exception_wrapper globalExceptionWrapper; //! //! // Thread1 //! void doSomethingCrazy() { //! int rc = doSomethingCrazyWithLameReturnCodes(); //! if (rc == NAILED_IT) { //! globalExceptionWrapper = exception_wrapper(); //! } else if (rc == FACE_PLANT) { //! globalExceptionWrapper = make_exception_wrapper<FacePlantException>(); //! } else if (rc == FAIL_WHALE) { //! globalExceptionWrapper = make_exception_wrapper<FailWhaleException>(); //! } //! } //! //! // Thread2: Exceptions are ok! //! void processResult() { //! try { //! globalExceptionWrapper.throw_exception(); //! } catch (const FacePlantException& e) { //! LOG(ERROR) << "FACEPLANT!"; //! } catch (const FailWhaleException& e) { //! LOG(ERROR) << "FAILWHALE!"; //! } //! } //! //! // Thread2: Exceptions are bad! //! void processResult() { //! globalExceptionWrapper.handle( //! [&](FacePlantException& faceplant) { //! LOG(ERROR) << "FACEPLANT"; //! }, //! [&](FailWhaleException& failwhale) { //! LOG(ERROR) << "FAILWHALE!"; //! }, //! [](...) { //! LOG(FATAL) << "Unrecognized exception"; //! }); //! } //! \endcode class exception_wrapper final { private: struct FOLLY_EXPORT AnyException : std::exception { std::type_info const* typeinfo_; template <class T> /* implicit */ AnyException(T&& t) noexcept : typeinfo_(&typeid(t)) {} }; </s> remove fbstring class_name() const { if (item_) { auto& i = *item_; return demangle(typeid(i)); } else if (eptr_) { return ename_; } else { return fbstring(); } } </s> add template <class Fn> struct arg_type_; template <class Fn> using arg_type = _t<arg_type_<Fn>>; // exception_wrapper is implemented as a simple variant over four // different representations: // 0. Empty, no exception. // 1. An small object stored in-situ. // 2. A larger object stored on the heap and referenced with a // std::shared_ptr. // 3. A std::exception_ptr, together with either: // a. A pointer to the referenced std::exception object, or // b. A pointer to a std::type_info object for the referenced exception, // or for an unspecified type if the type is unknown. // This is accomplished with the help of a union and a pointer to a hand- // rolled virtual table. This virtual table contains pointers to functions // that know which field of the union is active and do the proper action. // The class invariant ensures that the vtable ptr and the union stay in sync. struct VTable { void (*copy_)(exception_wrapper const*, exception_wrapper*); void (*move_)(exception_wrapper*, exception_wrapper*); void (*delete_)(exception_wrapper*); void (*throw_)(exception_wrapper const*); std::type_info const* (*type_)(exception_wrapper const*); std::exception const* (*get_exception_)(exception_wrapper const*); exception_wrapper (*get_exception_ptr_)(exception_wrapper const*); };
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/ExceptionWrapper.h
keep keep replace replace replace keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep
<mask> } <mask> <mask> explicit exception_wrapper(std::exception_ptr eptr) { <mask> assign_eptr(eptr); <mask> } <mask> <mask> // If the exception_wrapper does not contain an exception, std::terminate() <mask> // is invoked to assure the [[noreturn]] behaviour. <mask> [[noreturn]] void throwException() const { <mask> if (throwfn_) { <mask> throwfn_(item_.get()); <mask> } else if (eptr_) { <mask> std::rethrow_exception(eptr_); <mask> } <mask> std::cerr <mask> << "Cannot use `throwException` with an empty folly::exception_wrapper" <mask> << std::endl; <mask> std::terminate(); <mask> } <mask> <mask> explicit operator bool() const { <mask> return item_ || eptr_; <mask> } <mask> <mask> // This implementation is similar to std::exception_ptr's implementation </s> [sdk33] Update iOS with RN 0.59 </s> remove // This implementation is similar to std::exception_ptr's implementation // where two exception_wrappers are equal when the address in the underlying // reference field both point to the same exception object. The reference // field remains the same when the exception_wrapper is copied or when // the exception_wrapper is "rethrown". bool operator==(const exception_wrapper& a) const { if (item_) { return a.item_ && item_.get() == a.item_.get(); } else { return eptr_ == a.eptr_; } } </s> add template <class Fn, class A> FOLLY_ALWAYS_INLINE FOLLY_ATTR_VISIBILITY_HIDDEN auto fold(Fn&&, A&& a) { return static_cast<A&&>(a); } </s> remove // The following two constructors are meant to emulate the behavior of // try_and_catch in performance sensitive code as well as to be flexible // enough to wrap exceptions of unknown type. There is an overload that // takes an exception reference so that the wrapper can extract and store // the exception's type and what() when possible. // // The canonical use case is to construct an all-catching exception wrapper // with minimal overhead like so: // // try { // // some throwing code // } catch (const std::exception& e) { // // won't lose e's type and what() // exception_wrapper ew{std::current_exception(), e}; // } catch (...) { // // everything else // exception_wrapper ew{std::current_exception()}; // } // // try_and_catch is cleaner and preferable. Use it unless you're sure you need // something like this instead. template <typename Ex> explicit exception_wrapper(std::exception_ptr eptr, Ex& exn) { assign_eptr(eptr, exn); } </s> add namespace exception_wrapper_detail { </s> remove template <class Ex> bool is_compatible_with() const { if (item_) { return dynamic_cast<const Ex*>(item_.get()); } else if (eptr_) { try { std::rethrow_exception(eptr_); } catch (typename std::decay<Ex>::type&) { return true; } catch (...) { // fall through } } return false; } </s> add [[noreturn]] static void onNoExceptionError(char const* name); </s> remove throw std::system_error(err, std::system_category(), msg); </s> add throw makeSystemErrorExplicit(err, msg); </s> remove // TODO: we'd like to make use of makeSize (it can be optimized better, // because it manipulates the internals) // unfortunately the current implementation only supports moving from // a supplied rvalue, and doing an extra move just to reuse it is a perf // net loss if (size() == capacity()) {// && isInside(&t)) { value_type tmp(t); emplaceBack(std::move(tmp)); } else { emplaceBack(t); } </s> add emplace_back(t);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/ExceptionWrapper.h
keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace keep replace replace replace keep keep keep keep
<mask> return item_ || eptr_; <mask> } <mask> <mask> // This implementation is similar to std::exception_ptr's implementation <mask> // where two exception_wrappers are equal when the address in the underlying <mask> // reference field both point to the same exception object. The reference <mask> // field remains the same when the exception_wrapper is copied or when <mask> // the exception_wrapper is "rethrown". <mask> bool operator==(const exception_wrapper& a) const { <mask> if (item_) { <mask> return a.item_ && item_.get() == a.item_.get(); <mask> } else { <mask> return eptr_ == a.eptr_; <mask> } <mask> } <mask> <mask> bool operator!=(const exception_wrapper& a) const { <mask> return !(*this == a); <mask> } <mask> <mask> // This will return a non-nullptr only if the exception is held as a <mask> // copy. It is the only interface which will distinguish between an <mask> // exception held this way, and by exception_ptr. You probably </s> [sdk33] Update iOS with RN 0.59 </s> remove // If the exception_wrapper does not contain an exception, std::terminate() // is invoked to assure the [[noreturn]] behaviour. [[noreturn]] void throwException() const { if (throwfn_) { throwfn_(item_.get()); } else if (eptr_) { std::rethrow_exception(eptr_); } std::cerr << "Cannot use `throwException` with an empty folly::exception_wrapper" << std::endl; std::terminate(); } explicit operator bool() const { return item_ || eptr_; } </s> add template <bool If, class T> using AddConstIf = _t<std::conditional<If, const T, T>>; </s> remove // This will return a non-nullptr only if the exception is held as a // copy. It is the only interface which will distinguish between an // exception held this way, and by exception_ptr. You probably // shouldn't use it at all. std::exception* getCopied() { return item_.get(); } const std::exception* getCopied() const { return item_.get(); } fbstring what() const { if (item_) { return exceptionStr(*item_); } else if (eptr_) { return estr_; } else { return fbstring(); } } </s> add } // namespace exception_wrapper_detail //! Throwing exceptions can be a convenient way to handle errors. Storing //! exceptions in an `exception_ptr` makes it easy to handle exceptions in a //! different thread or at a later time. `exception_ptr` can also be used in a //! very generic result/exception wrapper. //! //! However, there are some issues with throwing exceptions and //! `std::exception_ptr`. These issues revolve around `throw` being expensive, //! particularly in a multithreaded environment (see //! ExceptionWrapperBenchmark.cpp). //! //! Imagine we have a library that has an API which returns a result/exception //! wrapper. Let's consider some approaches for implementing this wrapper. //! First, we could store a `std::exception`. This approach loses the derived //! exception type, which can make exception handling more difficult for users //! that prefer rethrowing the exception. We could use a `folly::dynamic` for //! every possible type of exception. This is not very flexible - adding new //! types of exceptions requires a change to the result/exception wrapper. We //! could use an `exception_ptr`. However, constructing an `exception_ptr` as //! well as accessing the error requires a call to throw. That means that there //! will be two calls to throw in order to process the exception. For //! performance sensitive applications, this may be unacceptable. //! //! `exception_wrapper` is designed to handle exception management for both //! convenience and high performance use cases. `make_exception_wrapper` is //! templated on derived type, allowing us to rethrow the exception properly for //! users that prefer convenience. These explicitly named exception types can //! therefore be handled without any peformance penalty. `exception_wrapper` is //! also flexible enough to accept any type. If a caught exception is not of an //! explicitly named type, then `std::exception_ptr` is used to preserve the //! exception state. For performance sensitive applications, the accessor //! methods can test or extract a pointer to a specific exception type with very //! little overhead. //! //! \par Example usage: //! \par //! \code //! exception_wrapper globalExceptionWrapper; //! //! // Thread1 //! void doSomethingCrazy() { //! int rc = doSomethingCrazyWithLameReturnCodes(); //! if (rc == NAILED_IT) { //! globalExceptionWrapper = exception_wrapper(); //! } else if (rc == FACE_PLANT) { //! globalExceptionWrapper = make_exception_wrapper<FacePlantException>(); //! } else if (rc == FAIL_WHALE) { //! globalExceptionWrapper = make_exception_wrapper<FailWhaleException>(); //! } //! } //! //! // Thread2: Exceptions are ok! //! void processResult() { //! try { //! globalExceptionWrapper.throw_exception(); //! } catch (const FacePlantException& e) { //! LOG(ERROR) << "FACEPLANT!"; //! } catch (const FailWhaleException& e) { //! LOG(ERROR) << "FAILWHALE!"; //! } //! } //! //! // Thread2: Exceptions are bad! //! void processResult() { //! globalExceptionWrapper.handle( //! [&](FacePlantException& faceplant) { //! LOG(ERROR) << "FACEPLANT"; //! }, //! [&](FailWhaleException& failwhale) { //! LOG(ERROR) << "FAILWHALE!"; //! }, //! [](...) { //! LOG(FATAL) << "Unrecognized exception"; //! }); //! } //! \endcode class exception_wrapper final { private: struct FOLLY_EXPORT AnyException : std::exception { std::type_info const* typeinfo_; template <class T> /* implicit */ AnyException(T&& t) noexcept : typeinfo_(&typeid(t)) {} }; </s> remove // The following two constructors are meant to emulate the behavior of // try_and_catch in performance sensitive code as well as to be flexible // enough to wrap exceptions of unknown type. There is an overload that // takes an exception reference so that the wrapper can extract and store // the exception's type and what() when possible. // // The canonical use case is to construct an all-catching exception wrapper // with minimal overhead like so: // // try { // // some throwing code // } catch (const std::exception& e) { // // won't lose e's type and what() // exception_wrapper ew{std::current_exception(), e}; // } catch (...) { // // everything else // exception_wrapper ew{std::current_exception()}; // } // // try_and_catch is cleaner and preferable. Use it unless you're sure you need // something like this instead. template <typename Ex> explicit exception_wrapper(std::exception_ptr eptr, Ex& exn) { assign_eptr(eptr, exn); } </s> add namespace exception_wrapper_detail { </s> remove fbstring class_name() const { if (item_) { auto& i = *item_; return demangle(typeid(i)); } else if (eptr_) { return ename_; } else { return fbstring(); } } </s> add template <class Fn> struct arg_type_; template <class Fn> using arg_type = _t<arg_type_<Fn>>; // exception_wrapper is implemented as a simple variant over four // different representations: // 0. Empty, no exception. // 1. An small object stored in-situ. // 2. A larger object stored on the heap and referenced with a // std::shared_ptr. // 3. A std::exception_ptr, together with either: // a. A pointer to the referenced std::exception object, or // b. A pointer to a std::type_info object for the referenced exception, // or for an unspecified type if the type is unknown. // This is accomplished with the help of a union and a pointer to a hand- // rolled virtual table. This virtual table contains pointers to functions // that know which field of the union is active and do the proper action. // The class invariant ensures that the vtable ptr and the union stay in sync. struct VTable { void (*copy_)(exception_wrapper const*, exception_wrapper*); void (*move_)(exception_wrapper*, exception_wrapper*); void (*delete_)(exception_wrapper*); void (*throw_)(exception_wrapper const*); std::type_info const* (*type_)(exception_wrapper const*); std::exception const* (*get_exception_)(exception_wrapper const*); exception_wrapper (*get_exception_ptr_)(exception_wrapper const*); }; </s> remove /* * Throwing exceptions can be a convenient way to handle errors. Storing * exceptions in an exception_ptr makes it easy to handle exceptions in a * different thread or at a later time. exception_ptr can also be used in a very * generic result/exception wrapper. * * However, there are some issues with throwing exceptions and * std::exception_ptr. These issues revolve around throw being expensive, * particularly in a multithreaded environment (see * ExceptionWrapperBenchmark.cpp). * * Imagine we have a library that has an API which returns a result/exception * wrapper. Let's consider some approaches for implementing this wrapper. * First, we could store a std::exception. This approach loses the derived * exception type, which can make exception handling more difficult for users * that prefer rethrowing the exception. We could use a folly::dynamic for every * possible type of exception. This is not very flexible - adding new types of * exceptions requires a change to the result/exception wrapper. We could use an * exception_ptr. However, constructing an exception_ptr as well as accessing * the error requires a call to throw. That means that there will be two calls * to throw in order to process the exception. For performance sensitive * applications, this may be unacceptable. * * exception_wrapper is designed to handle exception management for both * convenience and high performance use cases. make_exception_wrapper is * templated on derived type, allowing us to rethrow the exception properly for * users that prefer convenience. These explicitly named exception types can * therefore be handled without any peformance penalty. exception_wrapper is * also flexible enough to accept any type. If a caught exception is not of an * explicitly named type, then std::exception_ptr is used to preserve the * exception state. For performance sensitive applications, the accessor methods * can test or extract a pointer to a specific exception type with very little * overhead. * * Example usage: * * exception_wrapper globalExceptionWrapper; * * // Thread1 * void doSomethingCrazy() { * int rc = doSomethingCrazyWithLameReturnCodes(); * if (rc == NAILED_IT) { * globalExceptionWrapper = exception_wrapper(); * } else if (rc == FACE_PLANT) { * globalExceptionWrapper = make_exception_wrapper<FacePlantException>(); * } else if (rc == FAIL_WHALE) { * globalExceptionWrapper = make_exception_wrapper<FailWhaleException>(); * } * } * * // Thread2: Exceptions are ok! * void processResult() { * try { * globalExceptionWrapper.throwException(); * } catch (const FacePlantException& e) { * LOG(ERROR) << "FACEPLANT!"; * } catch (const FailWhaleException& e) { * LOG(ERROR) << "FAILWHALE!"; * } * } * * // Thread2: Exceptions are bad! * void processResult() { * globalExceptionWrapper.with_exception( * [&](FacePlantException& faceplant) { * LOG(ERROR) << "FACEPLANT"; * }) || * globalExceptionWrapper.with_exception( * [&](FailWhaleException& failwhale) { * LOG(ERROR) << "FAILWHALE!"; * }) || * LOG(FATAL) << "Unrecognized exception"; * } * */ class exception_wrapper { protected: template <typename Ex> struct optimize; </s> add #define FOLLY_REQUIRES_DEF(...) \ _t<std::enable_if<static_cast<bool>(__VA_ARGS__), long>>
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/ExceptionWrapper.h
keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep replace replace replace replace replace replace replace replace replace replace keep keep
<mask> } <mask> <mask> // This will return a non-nullptr only if the exception is held as a <mask> // copy. It is the only interface which will distinguish between an <mask> // exception held this way, and by exception_ptr. You probably <mask> // shouldn't use it at all. <mask> std::exception* getCopied() { return item_.get(); } <mask> const std::exception* getCopied() const { return item_.get(); } <mask> <mask> fbstring what() const { <mask> if (item_) { <mask> return exceptionStr(*item_); <mask> } else if (eptr_) { <mask> return estr_; <mask> } else { <mask> return fbstring(); <mask> } <mask> } <mask> <mask> fbstring class_name() const { <mask> if (item_) { <mask> auto& i = *item_; <mask> return demangle(typeid(i)); <mask> } else if (eptr_) { <mask> return ename_; <mask> } else { <mask> return fbstring(); <mask> } <mask> } <mask> <mask> template <class Ex> </s> [sdk33] Update iOS with RN 0.59 </s> remove bool operator!=(const exception_wrapper& a) const { return !(*this == a); } </s> add template <class Fn, class A, class B, class... Bs> FOLLY_ALWAYS_INLINE FOLLY_ATTR_VISIBILITY_HIDDEN auto fold(Fn&& fn, A&& a, B&& b, Bs&&... bs) { return fold( // This looks like a use of fn after a move of fn, but in reality, this is // just a cast and not a move. That's because regardless of which fold // overload is selected, fn gets bound to a &&. Had fold taken fn by value // there would indeed be a problem here. static_cast<Fn&&>(fn), static_cast<Fn&&>(fn)(static_cast<A&&>(a), static_cast<B&&>(b)), static_cast<Bs&&>(bs)...); } </s> remove template <class Ex> bool is_compatible_with() const { if (item_) { return dynamic_cast<const Ex*>(item_.get()); } else if (eptr_) { try { std::rethrow_exception(eptr_); } catch (typename std::decay<Ex>::type&) { return true; } catch (...) { // fall through } } return false; } </s> add [[noreturn]] static void onNoExceptionError(char const* name); </s> remove // This implementation is similar to std::exception_ptr's implementation // where two exception_wrappers are equal when the address in the underlying // reference field both point to the same exception object. The reference // field remains the same when the exception_wrapper is copied or when // the exception_wrapper is "rethrown". bool operator==(const exception_wrapper& a) const { if (item_) { return a.item_ && item_.get() == a.item_.get(); } else { return eptr_ == a.eptr_; } } </s> add template <class Fn, class A> FOLLY_ALWAYS_INLINE FOLLY_ATTR_VISIBILITY_HIDDEN auto fold(Fn&&, A&& a) { return static_cast<A&&>(a); } </s> remove // If the exception_wrapper does not contain an exception, std::terminate() // is invoked to assure the [[noreturn]] behaviour. [[noreturn]] void throwException() const { if (throwfn_) { throwfn_(item_.get()); } else if (eptr_) { std::rethrow_exception(eptr_); } std::cerr << "Cannot use `throwException` with an empty folly::exception_wrapper" << std::endl; std::terminate(); } explicit operator bool() const { return item_ || eptr_; } </s> add template <bool If, class T> using AddConstIf = _t<std::conditional<If, const T, T>>; </s> add } else { return static_cast<value_type*>(detail::shiftPointer( detail::pointerFlagClear(pdata_.heap_), kHeapifyCapacitySize));
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/ExceptionWrapper.h
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> return fbstring(); <mask> } <mask> } <mask> <mask> template <class Ex> <mask> bool is_compatible_with() const { <mask> if (item_) { <mask> return dynamic_cast<const Ex*>(item_.get()); <mask> } else if (eptr_) { <mask> try { <mask> std::rethrow_exception(eptr_); <mask> } catch (typename std::decay<Ex>::type&) { <mask> return true; <mask> } catch (...) { <mask> // fall through <mask> } <mask> } <mask> return false; <mask> } <mask> <mask> template <class F> <mask> bool with_exception(F&& f) { <mask> using arg_type = typename functor_traits<F>::arg_type_decayed; <mask> return with_exception<arg_type>(std::forward<F>(f)); </s> [sdk33] Update iOS with RN 0.59 </s> remove fbstring class_name() const { if (item_) { auto& i = *item_; return demangle(typeid(i)); } else if (eptr_) { return ename_; } else { return fbstring(); } } </s> add template <class Fn> struct arg_type_; template <class Fn> using arg_type = _t<arg_type_<Fn>>; // exception_wrapper is implemented as a simple variant over four // different representations: // 0. Empty, no exception. // 1. An small object stored in-situ. // 2. A larger object stored on the heap and referenced with a // std::shared_ptr. // 3. A std::exception_ptr, together with either: // a. A pointer to the referenced std::exception object, or // b. A pointer to a std::type_info object for the referenced exception, // or for an unspecified type if the type is unknown. // This is accomplished with the help of a union and a pointer to a hand- // rolled virtual table. This virtual table contains pointers to functions // that know which field of the union is active and do the proper action. // The class invariant ensures that the vtable ptr and the union stay in sync. struct VTable { void (*copy_)(exception_wrapper const*, exception_wrapper*); void (*move_)(exception_wrapper*, exception_wrapper*); void (*delete_)(exception_wrapper*); void (*throw_)(exception_wrapper const*); std::type_info const* (*type_)(exception_wrapper const*); std::exception const* (*get_exception_)(exception_wrapper const*); exception_wrapper (*get_exception_ptr_)(exception_wrapper const*); }; </s> remove // move old elements to the left of the new one try { detail::moveToUninitialized(begin(), begin() + pos, newp); } catch (...) { newp[pos].~value_type(); free(newh); throw; } // move old elements to the right of the new one try { if (pos < size-1) { detail::moveToUninitialized(begin() + pos, end(), newp + pos + 1); } } catch (...) { for (size_type i = 0; i <= pos; ++i) { newp[i].~value_type(); } free(newh); throw; } } else { // move without inserting new element try { detail::moveToUninitialized(begin(), end(), newp); } catch (...) { free(newh); throw; </s> add try { if (insert) { // move and insert the new element this->moveToUninitializedEmplace( begin(), end(), newp, pos, std::forward<EmplaceFunc>(emplaceFunc)); } else { // move without inserting new element this->moveToUninitialized(begin(), end(), newp); </s> remove } catch (const std::out_of_range& e) { </s> add } catch (const std::out_of_range&) { </s> remove auto dismissing(F f) -> typename std::result_of<F()>::type { SCOPE_EXIT { rehire(); }; </s> add auto dismissing(F f) -> invoke_result_t<F> { SCOPE_EXIT { rehire(); }; </s> remove template<class InputString, class OutputString> </s> add template <class InputString, class OutputString> </s> remove detail::populateMemForward(data(), n, [&] (void* p) { new (p) value_type(val); } ); </s> add detail::populateMemForward(data(), n, std::forward<InitFunc>(func));
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/ExceptionWrapper.h
keep keep keep keep replace keep keep keep keep keep
<mask> // data would trigger a new allocation. <mask> if (RefCounted::refs(ml_.data_) > 1) { <mask> return ml_.size_; <mask> } <mask> default: {} <mask> } <mask> return ml_.capacity(); <mask> } <mask> <mask> bool isShared() const { </s> [sdk33] Update iOS with RN 0.59 </s> remove private: </s> add private: </s> remove bool empty() const { return sl_->size() == 0; } size_t size() const { return sl_->size(); } size_type max_size() const { return std::numeric_limits<size_type>::max(); } </s> add bool empty() const { return sl_->size() == 0; } size_t size() const { return sl_->size(); } size_type max_size() const { return std::numeric_limits<size_type>::max(); } </s> remove for (; ht > 0 && less(data, node = pred->skip(ht - 1)); --ht) {} if (ht == 0) return std::make_pair(node, 0); // not found </s> add for (; ht > 0 && less(data, node = pred->skip(ht - 1)); --ht) { } if (ht == 0) { return std::make_pair(node, 0); // not found } </s> remove explicit ThreadLocal(std::function<T*()> constructor) : constructor_(constructor) { } T* get() const { T* ptr = tlp_.get(); if (LIKELY(ptr != nullptr)) { return ptr; } // separated new item creation out to speed up the fast path. return makeTlp(); </s> add template < typename F, _t<std::enable_if<is_invocable_r<T*, F>::value, int>> = 0> explicit ThreadLocal(F&& constructor) : constructor_(std::forward<F>(constructor)) {} FOLLY_ALWAYS_INLINE FOLLY_ATTR_VISIBILITY_HIDDEN T* get() const { auto const ptr = tlp_.get(); return FOLLY_LIKELY(!!ptr) ? ptr : makeTlp(); </s> remove break; </s> add default: assert(b == e); if (size == 0) { return makeUnexpected(ConversionCode::NO_DIGITS); } break; </s> remove bool fullyLinked() const { return getFlags() & FULLY_LINKED; } bool markedForRemoval() const { return getFlags() & MARKED_FOR_REMOVAL; } bool isHeadNode() const { return getFlags() & IS_HEAD_NODE; } </s> add bool fullyLinked() const { return getFlags() & FULLY_LINKED; } bool markedForRemoval() const { return getFlags() & MARKED_FOR_REMOVAL; } bool isHeadNode() const { return getFlags() & IS_HEAD_NODE; }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep replace keep replace keep
<mask> } <mask> <mask> private: <mask> // Disabled <mask> fbstring_core & operator=(const fbstring_core & rhs); <mask> </s> [sdk33] Update iOS with RN 0.59 </s> remove basic_fbstring & operator=(const std::string & rhs) { </s> add template <typename A2> basic_fbstring& operator=(const std::basic_string<E, T, A2>& rhs) { </s> remove bool fullyLinked() const { return getFlags() & FULLY_LINKED; } bool markedForRemoval() const { return getFlags() & MARKED_FOR_REMOVAL; } bool isHeadNode() const { return getFlags() & IS_HEAD_NODE; } </s> add bool fullyLinked() const { return getFlags() & FULLY_LINKED; } bool markedForRemoval() const { return getFlags() & MARKED_FOR_REMOVAL; } bool isHeadNode() const { return getFlags() & IS_HEAD_NODE; } </s> remove setFlags(getFlags() | IS_HEAD_NODE); </s> add setFlags(uint16_t(getFlags() | IS_HEAD_NODE)); </s> remove template <class T> T* pointerFlagSet(T* p) { return reinterpret_cast<T*>(reinterpret_cast<uintptr_t>(p) | 1); } template <class T> bool pointerFlagGet(T* p) { return reinterpret_cast<uintptr_t>(p) & 1; } template <class T> T* pointerFlagClear(T* p) { return reinterpret_cast<T*>( reinterpret_cast<uintptr_t>(p) & ~uintptr_t(1)); } inline void* shiftPointer(void* p, size_t sizeBytes) { return static_cast<char*>(p) + sizeBytes; } </s> add template <class T> T* pointerFlagSet(T* p) { return reinterpret_cast<T*>(reinterpret_cast<uintptr_t>(p) | 1); } template <class T> bool pointerFlagGet(T* p) { return reinterpret_cast<uintptr_t>(p) & 1; } template <class T> T* pointerFlagClear(T* p) { return reinterpret_cast<T*>(reinterpret_cast<uintptr_t>(p) & ~uintptr_t(1)); } inline void* shiftPointer(void* p, size_t sizeBytes) { return static_cast<char*>(p) + sizeBytes; </s> remove return kIsLittleEndian ? capacity_ & capacityExtractMask : capacity_ >> 2; </s> add return kIsLittleEndian ? capacity_ & capacityExtractMask : capacity_ >> 2;
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace replace replace replace replace keep keep replace keep keep keep keep
<mask> struct RefCounted { <mask> std::atomic<size_t> refCount_; <mask> Char data_[1]; <mask> <mask> static RefCounted * fromData(Char * p) { <mask> return static_cast<RefCounted*>( <mask> static_cast<void*>( <mask> static_cast<unsigned char*>(static_cast<void*>(p)) <mask> - sizeof(refCount_))); <mask> } <mask> <mask> static size_t refs(Char * p) { <mask> return fromData(p)->refCount_.load(std::memory_order_acquire); <mask> } <mask> <mask> static void incrementRefs(Char * p) { </s> [sdk33] Update iOS with RN 0.59 </s> remove static void incrementRefs(Char * p) { </s> add static void incrementRefs(Char* p) { </s> remove static void decrementRefs(Char * p) { </s> add static void decrementRefs(Char* p) { </s> remove static RefCounted * create(const Char * data, size_t * size) { </s> add static RefCounted* create(const Char* data, size_t* size) { </s> remove *size = (allocSize - sizeof(RefCounted)) / sizeof(Char); </s> add *size = (allocSize - getDataOffset()) / sizeof(Char) - 1; </s> remove static RefCounted * create(size_t * size) { // Don't forget to allocate one extra Char for the terminating // null. In this case, however, one Char is already part of the // struct. const size_t allocSize = goodMallocSize( sizeof(RefCounted) + *size * sizeof(Char)); </s> add static RefCounted* create(size_t* size) { const size_t allocSize = goodMallocSize(getDataOffset() + (*size + 1) * sizeof(Char));
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep replace keep keep
<mask> static size_t refs(Char * p) { <mask> return fromData(p)->refCount_.load(std::memory_order_acquire); <mask> } <mask> <mask> static void incrementRefs(Char * p) { <mask> fromData(p)->refCount_.fetch_add(1, std::memory_order_acq_rel); <mask> } <mask> <mask> static void decrementRefs(Char * p) { <mask> auto const dis = fromData(p); <mask> size_t oldcnt = dis->refCount_.fetch_sub(1, std::memory_order_acq_rel); </s> [sdk33] Update iOS with RN 0.59 </s> remove static size_t refs(Char * p) { </s> add static RefCounted* fromData(Char* p) { return static_cast<RefCounted*>(static_cast<void*>( static_cast<unsigned char*>(static_cast<void*>(p)) - getDataOffset())); } static size_t refs(Char* p) { </s> remove static RefCounted * fromData(Char * p) { return static_cast<RefCounted*>( static_cast<void*>( static_cast<unsigned char*>(static_cast<void*>(p)) - sizeof(refCount_))); </s> add constexpr static size_t getDataOffset() { return offsetof(RefCounted, data_); </s> remove template <class T> T* pointerFlagSet(T* p) { return reinterpret_cast<T*>(reinterpret_cast<uintptr_t>(p) | 1); } template <class T> bool pointerFlagGet(T* p) { return reinterpret_cast<uintptr_t>(p) & 1; } template <class T> T* pointerFlagClear(T* p) { return reinterpret_cast<T*>( reinterpret_cast<uintptr_t>(p) & ~uintptr_t(1)); } inline void* shiftPointer(void* p, size_t sizeBytes) { return static_cast<char*>(p) + sizeBytes; } </s> add template <class T> T* pointerFlagSet(T* p) { return reinterpret_cast<T*>(reinterpret_cast<uintptr_t>(p) | 1); } template <class T> bool pointerFlagGet(T* p) { return reinterpret_cast<uintptr_t>(p) & 1; } template <class T> T* pointerFlagClear(T* p) { return reinterpret_cast<T*>(reinterpret_cast<uintptr_t>(p) & ~uintptr_t(1)); } inline void* shiftPointer(void* p, size_t sizeBytes) { return static_cast<char*>(p) + sizeBytes; </s> remove static RefCounted * create(const Char * data, size_t * size) { </s> add static RefCounted* create(const Char* data, size_t* size) { </s> add static ProcessReturnCode makeNotStarted() { return ProcessReturnCode(RV_NOT_STARTED); } static ProcessReturnCode makeRunning() { return ProcessReturnCode(RV_RUNNING); } static ProcessReturnCode make(int status);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep replace replace replace replace replace replace keep keep replace keep keep
<mask> } <mask> <mask> static RefCounted * create(size_t * size) { <mask> // Don't forget to allocate one extra Char for the terminating <mask> // null. In this case, however, one Char is already part of the <mask> // struct. <mask> const size_t allocSize = goodMallocSize( <mask> sizeof(RefCounted) + *size * sizeof(Char)); <mask> auto result = static_cast<RefCounted*>(checkedMalloc(allocSize)); <mask> result->refCount_.store(1, std::memory_order_release); <mask> *size = (allocSize - sizeof(RefCounted)) / sizeof(Char); <mask> return result; <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove // Don't forget to allocate one extra Char for the terminating // null. In this case, however, one Char is already part of the // struct. auto result = static_cast<RefCounted*>( smartRealloc(dis, sizeof(RefCounted) + currentSize * sizeof(Char), sizeof(RefCounted) + currentCapacity * sizeof(Char), sizeof(RefCounted) + newCapacity * sizeof(Char))); </s> add auto result = static_cast<RefCounted*>(smartRealloc( dis, getDataOffset() + (currentSize + 1) * sizeof(Char), getDataOffset() + (currentCapacity + 1) * sizeof(Char), allocNewCapacity)); </s> remove static RefCounted * reallocate(Char *const data, const size_t currentSize, const size_t currentCapacity, const size_t newCapacity) { FBSTRING_ASSERT(newCapacity > 0 && newCapacity > currentSize); </s> add static RefCounted* reallocate( Char* const data, const size_t currentSize, const size_t currentCapacity, size_t* newCapacity) { FBSTRING_ASSERT(*newCapacity > 0 && *newCapacity > currentSize); const size_t allocNewCapacity = goodMallocSize(getDataOffset() + (*newCapacity + 1) * sizeof(Char)); </s> remove static RefCounted * create(const Char * data, size_t * size) { </s> add static RefCounted* create(const Char* data, size_t* size) { </s> remove const Char* const data, const size_t size) { </s> add const Char* const data, const size_t size) { </s> remove static RefCounted * fromData(Char * p) { return static_cast<RefCounted*>( static_cast<void*>( static_cast<unsigned char*>(static_cast<void*>(p)) - sizeof(refCount_))); </s> add constexpr static size_t getDataOffset() { return offsetof(RefCounted, data_);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> *size = (allocSize - sizeof(RefCounted)) / sizeof(Char); <mask> return result; <mask> } <mask> <mask> static RefCounted * create(const Char * data, size_t * size) { <mask> const size_t effectiveSize = *size; <mask> auto result = create(size); <mask> if (FBSTRING_LIKELY(effectiveSize > 0)) { <mask> fbstring_detail::podCopy(data, data + effectiveSize, result->data_); <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove *size = (allocSize - sizeof(RefCounted)) / sizeof(Char); </s> add *size = (allocSize - getDataOffset()) / sizeof(Char) - 1; </s> remove static RefCounted * create(size_t * size) { // Don't forget to allocate one extra Char for the terminating // null. In this case, however, one Char is already part of the // struct. const size_t allocSize = goodMallocSize( sizeof(RefCounted) + *size * sizeof(Char)); </s> add static RefCounted* create(size_t* size) { const size_t allocSize = goodMallocSize(getDataOffset() + (*size + 1) * sizeof(Char)); </s> remove const Char* const data, const size_t size) { </s> add const Char* const data, const size_t size) { </s> remove static RefCounted * reallocate(Char *const data, const size_t currentSize, const size_t currentCapacity, const size_t newCapacity) { FBSTRING_ASSERT(newCapacity > 0 && newCapacity > currentSize); </s> add static RefCounted* reallocate( Char* const data, const size_t currentSize, const size_t currentCapacity, size_t* newCapacity) { FBSTRING_ASSERT(*newCapacity > 0 && *newCapacity > currentSize); const size_t allocNewCapacity = goodMallocSize(getDataOffset() + (*newCapacity + 1) * sizeof(Char)); </s> remove static RefCounted * fromData(Char * p) { return static_cast<RefCounted*>( static_cast<void*>( static_cast<unsigned char*>(static_cast<void*>(p)) - sizeof(refCount_))); </s> add constexpr static size_t getDataOffset() { return offsetof(RefCounted, data_); </s> remove // Don't forget to allocate one extra Char for the terminating // null. In this case, however, one Char is already part of the // struct. auto result = static_cast<RefCounted*>( smartRealloc(dis, sizeof(RefCounted) + currentSize * sizeof(Char), sizeof(RefCounted) + currentCapacity * sizeof(Char), sizeof(RefCounted) + newCapacity * sizeof(Char))); </s> add auto result = static_cast<RefCounted*>(smartRealloc( dis, getDataOffset() + (currentSize + 1) * sizeof(Char), getDataOffset() + (currentCapacity + 1) * sizeof(Char), allocNewCapacity));
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep replace replace replace replace replace keep keep replace replace replace replace replace replace replace replace keep keep keep
<mask> } <mask> <mask> static RefCounted * reallocate(Char *const data, <mask> const size_t currentSize, <mask> const size_t currentCapacity, <mask> const size_t newCapacity) { <mask> FBSTRING_ASSERT(newCapacity > 0 && newCapacity > currentSize); <mask> auto const dis = fromData(data); <mask> FBSTRING_ASSERT(dis->refCount_.load(std::memory_order_acquire) == 1); <mask> // Don't forget to allocate one extra Char for the terminating <mask> // null. In this case, however, one Char is already part of the <mask> // struct. <mask> auto result = static_cast<RefCounted*>( <mask> smartRealloc(dis, <mask> sizeof(RefCounted) + currentSize * sizeof(Char), <mask> sizeof(RefCounted) + currentCapacity * sizeof(Char), <mask> sizeof(RefCounted) + newCapacity * sizeof(Char))); <mask> FBSTRING_ASSERT(result->refCount_.load(std::memory_order_acquire) == 1); <mask> return result; <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove static RefCounted * create(size_t * size) { // Don't forget to allocate one extra Char for the terminating // null. In this case, however, one Char is already part of the // struct. const size_t allocSize = goodMallocSize( sizeof(RefCounted) + *size * sizeof(Char)); </s> add static RefCounted* create(size_t* size) { const size_t allocSize = goodMallocSize(getDataOffset() + (*size + 1) * sizeof(Char)); </s> remove const Char* const data, const size_t size) { </s> add const Char* const data, const size_t size) { </s> remove *size = (allocSize - sizeof(RefCounted)) / sizeof(Char); </s> add *size = (allocSize - getDataOffset()) / sizeof(Char) - 1; </s> remove static RefCounted * create(const Char * data, size_t * size) { </s> add static RefCounted* create(const Char* data, size_t* size) { </s> add *newCapacity = (allocNewCapacity - getDataOffset()) / sizeof(Char) - 1;
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep add keep keep keep keep keep keep
<mask> getDataOffset() + (currentSize + 1) * sizeof(Char), <mask> getDataOffset() + (currentCapacity + 1) * sizeof(Char), <mask> allocNewCapacity)); <mask> FBSTRING_ASSERT(result->refCount_.load(std::memory_order_acquire) == 1); <mask> return result; <mask> } <mask> }; <mask> <mask> typedef uint8_t category_type; <mask> </s> [sdk33] Update iOS with RN 0.59 </s> remove // Don't forget to allocate one extra Char for the terminating // null. In this case, however, one Char is already part of the // struct. auto result = static_cast<RefCounted*>( smartRealloc(dis, sizeof(RefCounted) + currentSize * sizeof(Char), sizeof(RefCounted) + currentCapacity * sizeof(Char), sizeof(RefCounted) + newCapacity * sizeof(Char))); </s> add auto result = static_cast<RefCounted*>(smartRealloc( dis, getDataOffset() + (currentSize + 1) * sizeof(Char), getDataOffset() + (currentCapacity + 1) * sizeof(Char), allocNewCapacity)); </s> remove makeSize(size() + 1); detail::moveObjectsRight(data() + offset, data() + size(), data() + size() + 1); </s> add detail::moveObjectsRight( data() + offset, data() + size(), data() + size() + 1); </s> remove static RefCounted * create(size_t * size) { // Don't forget to allocate one extra Char for the terminating // null. In this case, however, one Char is already part of the // struct. const size_t allocSize = goodMallocSize( sizeof(RefCounted) + *size * sizeof(Char)); </s> add static RefCounted* create(size_t* size) { const size_t allocSize = goodMallocSize(getDataOffset() + (*size + 1) * sizeof(Char)); </s> remove template <typename T, typename = void> struct constexpr_abs_helper {}; template <typename T> struct constexpr_abs_helper< T, typename std::enable_if<std::is_floating_point<T>::value>::type> { static constexpr T go(T t) { return t < static_cast<T>(0) ? -t : t; } }; template <typename T> struct constexpr_abs_helper< T, typename std::enable_if< std::is_integral<T>::value && !std::is_same<T, bool>::value && std::is_unsigned<T>::value>::type> { static constexpr T go(T t) { return t; } }; template <typename T> struct constexpr_abs_helper< T, typename std::enable_if< std::is_integral<T>::value && !std::is_same<T, bool>::value && std::is_signed<T>::value>::type> { static constexpr typename std::make_unsigned<T>::type go(T t) { return t < static_cast<T>(0) ? -t : t; } }; </s> add template <typename Char> constexpr size_t constexpr_strlen_internal(const Char* s, size_t len) { // clang-format off return *(s + 0) == Char(0) ? len + 0 : *(s + 1) == Char(0) ? len + 1 : *(s + 2) == Char(0) ? len + 2 : *(s + 3) == Char(0) ? len + 3 : *(s + 4) == Char(0) ? len + 4 : *(s + 5) == Char(0) ? len + 5 : *(s + 6) == Char(0) ? len + 6 : *(s + 7) == Char(0) ? len + 7 : constexpr_strlen_internal(s + 8, len + 8); // clang-format on </s> remove static RefCounted * reallocate(Char *const data, const size_t currentSize, const size_t currentCapacity, const size_t newCapacity) { FBSTRING_ASSERT(newCapacity > 0 && newCapacity > currentSize); </s> add static RefCounted* reallocate( Char* const data, const size_t currentSize, const size_t currentCapacity, size_t* newCapacity) { FBSTRING_ASSERT(*newCapacity > 0 && *newCapacity > currentSize); const size_t allocNewCapacity = goodMallocSize(getDataOffset() + (*newCapacity + 1) * sizeof(Char)); </s> remove makeSize(size() + 1, &t, offset); </s> add makeSize( size() + 1, [&t](void* ptr) { new (ptr) value_type(std::move(t)); }, offset);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep replace replace replace keep keep keep keep
<mask> return static_cast<Category>(bytes_[lastChar] & categoryExtractMask); <mask> } <mask> <mask> struct MediumLarge { <mask> Char * data_; <mask> size_t size_; <mask> size_t capacity_; <mask> <mask> size_t capacity() const { <mask> return kIsLittleEndian <mask> ? capacity_ & capacityExtractMask <mask> : capacity_ >> 2; <mask> } <mask> <mask> void setCapacity(size_t cap, Category cat) { <mask> capacity_ = kIsLittleEndian </s> [sdk33] Update iOS with RN 0.59 </s> remove static_assert(!(sizeof(MediumLarge) % sizeof(Char)), "Corrupt memory layout for fbstring."); </s> add static_assert( !(sizeof(MediumLarge) % sizeof(Char)), "Corrupt memory layout for fbstring."); </s> remove : backend_(another.backend_) { } dummy_fbstring_core(const Char * s, size_t n) : backend_(s, n) { } void swap(dummy_fbstring_core & rhs) { </s> add : backend_(another.backend_) {} dummy_fbstring_core(const Char* s, size_t n) : backend_(s, n) {} void swap(dummy_fbstring_core& rhs) { </s> remove const Char* const data, const size_t size) { </s> add const Char* const data, const size_t size) { </s> remove template<class SizeType, bool ShouldUseHeap> struct IntegralSizePolicy { typedef SizeType InternalSizeType; IntegralSizePolicy() : size_(0) {} protected: static constexpr std::size_t policyMaxSize() { return SizeType(~kExternMask); } std::size_t doSize() const { return size_ & ~kExternMask; } std::size_t isExtern() const { return kExternMask & size_; } void setExtern(bool b) { if (b) { size_ |= kExternMask; } else { size_ &= ~kExternMask; } } void setSize(std::size_t sz) { assert(sz <= policyMaxSize()); size_ = (kExternMask & size_) | SizeType(sz); } void swapSizePolicy(IntegralSizePolicy& o) { std::swap(size_, o.size_); } protected: static bool const kShouldUseHeap = ShouldUseHeap; private: static SizeType const kExternMask = kShouldUseHeap ? SizeType(1) << (sizeof(SizeType) * 8 - 1) : 0; </s> add template <class SizeType> struct IntegralSizePolicy<SizeType, false> : public IntegralSizePolicyBase<SizeType, false> { public: template <class T> void moveToUninitialized(T* /*first*/, T* /*last*/, T* /*out*/) { assume_unreachable(); } template <class T, class EmplaceFunc> void moveToUninitializedEmplace( T* /* begin */, T* /* end */, T* /* out */, SizeType /* pos */, EmplaceFunc&& /* emplaceFunc */) { assume_unreachable(); } }; </s> remove const Char * data() const { </s> add const Char* data() const {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace replace keep keep keep keep keep
<mask> constexpr static size_t capacityExtractMask = kIsLittleEndian <mask> ? ~(size_t(categoryExtractMask) << kCategoryShift) <mask> : 0x0 /* unused */; <mask> <mask> static_assert(!(sizeof(MediumLarge) % sizeof(Char)), <mask> "Corrupt memory layout for fbstring."); <mask> <mask> size_t smallSize() const { <mask> FBSTRING_ASSERT(category() == Category::isSmall); <mask> constexpr auto shift = kIsLittleEndian ? 0 : 2; <mask> auto smallShifted = static_cast<size_t>(small_[maxSmallSize]) >> shift; </s> [sdk33] Update iOS with RN 0.59 </s> remove return kIsLittleEndian ? capacity_ & capacityExtractMask : capacity_ >> 2; </s> add return kIsLittleEndian ? capacity_ & capacityExtractMask : capacity_ >> 2; </s> remove small_[maxSmallSize] = (maxSmallSize - s) << shift; </s> add small_[maxSmallSize] = char((maxSmallSize - s) << shift); </s> remove template <typename T, typename = void> struct constexpr_abs_helper {}; template <typename T> struct constexpr_abs_helper< T, typename std::enable_if<std::is_floating_point<T>::value>::type> { static constexpr T go(T t) { return t < static_cast<T>(0) ? -t : t; } }; template <typename T> struct constexpr_abs_helper< T, typename std::enable_if< std::is_integral<T>::value && !std::is_same<T, bool>::value && std::is_unsigned<T>::value>::type> { static constexpr T go(T t) { return t; } }; template <typename T> struct constexpr_abs_helper< T, typename std::enable_if< std::is_integral<T>::value && !std::is_same<T, bool>::value && std::is_signed<T>::value>::type> { static constexpr typename std::make_unsigned<T>::type go(T t) { return t < static_cast<T>(0) ? -t : t; } }; </s> add template <typename Char> constexpr size_t constexpr_strlen_internal(const Char* s, size_t len) { // clang-format off return *(s + 0) == Char(0) ? len + 0 : *(s + 1) == Char(0) ? len + 1 : *(s + 2) == Char(0) ? len + 2 : *(s + 3) == Char(0) ? len + 3 : *(s + 4) == Char(0) ? len + 4 : *(s + 5) == Char(0) ? len + 5 : *(s + 6) == Char(0) ? len + 6 : *(s + 7) == Char(0) ? len + 7 : constexpr_strlen_internal(s + 8, len + 8); // clang-format on </s> remove template <typename T> constexpr auto constexpr_abs(T t) -> decltype(detail::constexpr_abs_helper<T>::go(t)) { return detail::constexpr_abs_helper<T>::go(t); </s> add template <typename Char> constexpr int constexpr_strcmp_internal(const Char* s1, const Char* s2) { return (*s1 == '\0' || *s1 != *s2) ? (static_cast<int>(*s1 - *s2)) : constexpr_strcmp_internal(s1 + 1, s2 + 1); </s> remove #if defined(__clang__) </s> add #if FOLLY_HAS_FEATURE(cxx_constexpr_string_builtins) // clang provides a constexpr builtin </s> remove #elif defined(_MSC_VER) return s == nullptr ? 0 : constexpr_strlen_internal(s, 0); #else </s> add #elif defined(__GNUC__) && !defined(__clang__) // strlen() happens to already be constexpr under gcc
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> // so don't assume anything about the previous value of <mask> // small_[maxSmallSize]. <mask> FBSTRING_ASSERT(s <= maxSmallSize); <mask> constexpr auto shift = kIsLittleEndian ? 0 : 2; <mask> small_[maxSmallSize] = (maxSmallSize - s) << shift; <mask> small_[s] = '\0'; <mask> FBSTRING_ASSERT(category() == Category::isSmall && size() == s); <mask> } <mask> <mask> void copySmall(const fbstring_core&); </s> [sdk33] Update iOS with RN 0.59 </s> remove static_assert(!(sizeof(MediumLarge) % sizeof(Char)), "Corrupt memory layout for fbstring."); </s> add static_assert( !(sizeof(MediumLarge) % sizeof(Char)), "Corrupt memory layout for fbstring."); </s> remove return begin() <= end() && empty() == (size() == 0) && empty() == (begin() == end()) && size() <= max_size() && capacity() <= max_size() && size() <= capacity() && begin()[size()] == '\0'; </s> add return begin() <= end() && empty() == (size() == 0) && empty() == (begin() == end()) && size() <= max_size() && capacity() <= max_size() && size() <= capacity() && begin()[size()] == '\0'; </s> remove return kIsLittleEndian ? capacity_ & capacityExtractMask : capacity_ >> 2; </s> add return kIsLittleEndian ? capacity_ & capacityExtractMask : capacity_ >> 2; </s> remove #elif defined(_MSC_VER) return s == nullptr ? 0 : constexpr_strlen_internal(s, 0); #else </s> add #elif defined(__GNUC__) && !defined(__clang__) // strlen() happens to already be constexpr under gcc </s> remove template <typename T, typename = void> struct constexpr_abs_helper {}; template <typename T> struct constexpr_abs_helper< T, typename std::enable_if<std::is_floating_point<T>::value>::type> { static constexpr T go(T t) { return t < static_cast<T>(0) ? -t : t; } }; template <typename T> struct constexpr_abs_helper< T, typename std::enable_if< std::is_integral<T>::value && !std::is_same<T, bool>::value && std::is_unsigned<T>::value>::type> { static constexpr T go(T t) { return t; } }; template <typename T> struct constexpr_abs_helper< T, typename std::enable_if< std::is_integral<T>::value && !std::is_same<T, bool>::value && std::is_signed<T>::value>::type> { static constexpr typename std::make_unsigned<T>::type go(T t) { return t < static_cast<T>(0) ? -t : t; } }; </s> add template <typename Char> constexpr size_t constexpr_strlen_internal(const Char* s, size_t len) { // clang-format off return *(s + 0) == Char(0) ? len + 0 : *(s + 1) == Char(0) ? len + 1 : *(s + 2) == Char(0) ? len + 2 : *(s + 3) == Char(0) ? len + 3 : *(s + 4) == Char(0) ? len + 4 : *(s + 5) == Char(0) ? len + 5 : *(s + 6) == Char(0) ? len + 6 : *(s + 7) == Char(0) ? len + 7 : constexpr_strlen_internal(s + 8, len + 8); // clang-format on </s> remove auto unhex = [](char c) -> int { return c >= '0' && c <= '9' ? c - '0' : c >= 'A' && c <= 'F' ? c - 'A' + 10 : c >= 'a' && c <= 'f' ? c - 'a' + 10 : -1; }; </s> add
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> // Small strings are bitblitted <mask> template <class Char> <mask> inline void fbstring_core<Char>::initSmall( <mask> const Char* const data, const size_t size) { <mask> // Layout is: Char* data_, size_t size_, size_t capacity_ <mask> static_assert( <mask> sizeof(*this) == sizeof(Char*) + 2 * sizeof(size_t), <mask> "fbstring has unexpected size"); <mask> static_assert( </s> [sdk33] Update iOS with RN 0.59 </s> remove const Char* const data, const size_t size) { </s> add const Char* const data, const size_t size) { </s> remove const Char* const data, const size_t size) { </s> add const Char* const data, const size_t size) { </s> remove static RefCounted * create(const Char * data, size_t * size) { </s> add static RefCounted* create(const Char* data, size_t* size) { </s> add static_assert( constexpr_strlen_internal("123456789", 0) == 9, "Someone appears to have broken constexpr_strlen..."); </s> remove static RefCounted * reallocate(Char *const data, const size_t currentSize, const size_t currentCapacity, const size_t newCapacity) { FBSTRING_ASSERT(newCapacity > 0 && newCapacity > currentSize); </s> add static RefCounted* reallocate( Char* const data, const size_t currentSize, const size_t currentCapacity, size_t* newCapacity) { FBSTRING_ASSERT(*newCapacity > 0 && *newCapacity > currentSize); const size_t allocNewCapacity = goodMallocSize(getDataOffset() + (*newCapacity + 1) * sizeof(Char)); </s> remove template <typename T> constexpr auto constexpr_abs(T t) -> decltype(detail::constexpr_abs_helper<T>::go(t)) { return detail::constexpr_abs_helper<T>::go(t); </s> add template <typename Char> constexpr int constexpr_strcmp_internal(const Char* s1, const Char* s2) { return (*s1 == '\0' || *s1 != *s2) ? (static_cast<int>(*s1 - *s2)) : constexpr_strcmp_internal(s1 + 1, s2 + 1);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep add keep keep keep keep
<mask> case 3: <mask> ml_.capacity_ = reinterpret_cast<const size_t*>(data)[2]; <mask> case 2: <mask> ml_.size_ = reinterpret_cast<const size_t*>(data)[1]; <mask> FOLLY_FALLTHROUGH; <mask> case 1: </s> [sdk33] Update iOS with RN 0.59 </s> add FOLLY_FALLTHROUGH; </s> add FOLLY_FALLTHROUGH; </s> remove case Op::FULL: return true; </s> add </s> remove case 3: { const int32_t r0 = shift100[static_cast<size_t>(b[0])]; const int32_t r1 = shift10[static_cast<size_t>(b[1])]; const int32_t r2 = shift1[static_cast<size_t>(b[2])]; const auto sum = r0 + r1 + r2; if (sum >= OOR) { goto outOfRange; } result = 1000 * result + sum; break; } case 2: { const int32_t r0 = shift10[static_cast<size_t>(b[0])]; const int32_t r1 = shift1[static_cast<size_t>(b[1])]; const auto sum = r0 + r1; if (sum >= OOR) { goto outOfRange; </s> add case 3: { const int32_t r0 = shift100[static_cast<size_t>(b[0])]; const int32_t r1 = shift10[static_cast<size_t>(b[1])]; const int32_t r2 = shift1[static_cast<size_t>(b[2])]; const auto sum = r0 + r1 + r2; if (sum >= OOR) { goto outOfRange; } result = UT(1000 * result + sum); break; </s> remove result = 100 * result + sum; break; } case 1: { const int32_t sum = shift1[static_cast<size_t>(b[0])]; if (sum >= OOR) { goto outOfRange; </s> add case 2: { const int32_t r0 = shift10[static_cast<size_t>(b[0])]; const int32_t r1 = shift1[static_cast<size_t>(b[1])]; const auto sum = r0 + r1; if (sum >= OOR) { goto outOfRange; } result = UT(100 * result + sum); break; </s> remove ++b; // accept the single 'y' character </s> add ++b; // accept the single 'y' character
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep add keep keep keep keep
<mask> case 2: <mask> ml_.size_ = reinterpret_cast<const size_t*>(data)[1]; <mask> case 1: <mask> ml_.data_ = *reinterpret_cast<Char**>(const_cast<Char*>(data)); <mask> FOLLY_FALLTHROUGH; <mask> case 0: </s> [sdk33] Update iOS with RN 0.59 </s> add FOLLY_FALLTHROUGH; </s> add FOLLY_FALLTHROUGH; </s> remove case Op::FULL: return true; </s> add </s> remove case 3: { const int32_t r0 = shift100[static_cast<size_t>(b[0])]; const int32_t r1 = shift10[static_cast<size_t>(b[1])]; const int32_t r2 = shift1[static_cast<size_t>(b[2])]; const auto sum = r0 + r1 + r2; if (sum >= OOR) { goto outOfRange; } result = 1000 * result + sum; break; } case 2: { const int32_t r0 = shift10[static_cast<size_t>(b[0])]; const int32_t r1 = shift1[static_cast<size_t>(b[1])]; const auto sum = r0 + r1; if (sum >= OOR) { goto outOfRange; </s> add case 3: { const int32_t r0 = shift100[static_cast<size_t>(b[0])]; const int32_t r1 = shift10[static_cast<size_t>(b[1])]; const int32_t r2 = shift1[static_cast<size_t>(b[2])]; const auto sum = r0 + r1 + r2; if (sum >= OOR) { goto outOfRange; } result = UT(1000 * result + sum); break; </s> remove result = 100 * result + sum; break; } case 1: { const int32_t sum = shift1[static_cast<size_t>(b[0])]; if (sum >= OOR) { goto outOfRange; </s> add case 2: { const int32_t r0 = shift10[static_cast<size_t>(b[0])]; const int32_t r1 = shift1[static_cast<size_t>(b[1])]; const auto sum = r0 + r1; if (sum >= OOR) { goto outOfRange; } result = UT(100 * result + sum); break; </s> remove ++b; // accept the single 'y' character </s> add ++b; // accept the single 'y' character
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep add keep keep keep keep
<mask> FOLLY_FALLTHROUGH; <mask> case 1: <mask> ml_.data_ = *reinterpret_cast<Char**>(const_cast<Char*>(data)); <mask> case 0: <mask> break; <mask> } <mask> } else </s> [sdk33] Update iOS with RN 0.59 </s> add FOLLY_FALLTHROUGH; </s> remove case Op::FULL: return true; </s> add </s> add FOLLY_FALLTHROUGH; </s> remove case '+': if (mode == UriEscapeMode::QUERY) { out.append(&*last, p - last); out.push_back(' '); </s> add case '+': if (mode == UriEscapeMode::QUERY) { out.append(&*last, size_t(p - last)); out.push_back(' '); ++p; last = p; break; } // else fallthrough FOLLY_FALLTHROUGH; default: </s> remove case Op::FULL: </s> add </s> remove result = 100 * result + sum; break; } case 1: { const int32_t sum = shift1[static_cast<size_t>(b[0])]; if (sum >= OOR) { goto outOfRange; </s> add case 2: { const int32_t r0 = shift10[static_cast<size_t>(b[0])]; const int32_t r1 = shift1[static_cast<size_t>(b[1])]; const auto sum = r0 + r1; if (sum >= OOR) { goto outOfRange; } result = UT(100 * result + sum); break;
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> template <class Char> <mask> FOLLY_MALLOC_NOINLINE inline void fbstring_core<Char>::initMedium( <mask> const Char* const data, const size_t size) { <mask> // Medium strings are allocated normally. Don't forget to <mask> // allocate one extra Char for the terminating null. <mask> auto const allocSize = goodMallocSize((1 + size) * sizeof(Char)); <mask> ml_.data_ = static_cast<Char*>(checkedMalloc(allocSize)); <mask> if (FBSTRING_LIKELY(size > 0)) { </s> [sdk33] Update iOS with RN 0.59 </s> remove const Char* const data, const size_t size) { </s> add const Char* const data, const size_t size) { </s> remove static RefCounted * create(size_t * size) { // Don't forget to allocate one extra Char for the terminating // null. In this case, however, one Char is already part of the // struct. const size_t allocSize = goodMallocSize( sizeof(RefCounted) + *size * sizeof(Char)); </s> add static RefCounted* create(size_t* size) { const size_t allocSize = goodMallocSize(getDataOffset() + (*size + 1) * sizeof(Char)); </s> remove static RefCounted * reallocate(Char *const data, const size_t currentSize, const size_t currentCapacity, const size_t newCapacity) { FBSTRING_ASSERT(newCapacity > 0 && newCapacity > currentSize); </s> add static RefCounted* reallocate( Char* const data, const size_t currentSize, const size_t currentCapacity, size_t* newCapacity) { FBSTRING_ASSERT(*newCapacity > 0 && *newCapacity > currentSize); const size_t allocNewCapacity = goodMallocSize(getDataOffset() + (*newCapacity + 1) * sizeof(Char)); </s> remove const Char* const data, const size_t size) { </s> add const Char* const data, const size_t size) { </s> remove static RefCounted * create(const Char * data, size_t * size) { </s> add static RefCounted* create(const Char* data, size_t* size) { </s> remove // Don't forget to allocate one extra Char for the terminating // null. In this case, however, one Char is already part of the // struct. auto result = static_cast<RefCounted*>( smartRealloc(dis, sizeof(RefCounted) + currentSize * sizeof(Char), sizeof(RefCounted) + currentCapacity * sizeof(Char), sizeof(RefCounted) + newCapacity * sizeof(Char))); </s> add auto result = static_cast<RefCounted*>(smartRealloc( dis, getDataOffset() + (currentSize + 1) * sizeof(Char), getDataOffset() + (currentCapacity + 1) * sizeof(Char), allocNewCapacity));
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> template <class Char> <mask> FOLLY_MALLOC_NOINLINE inline void fbstring_core<Char>::initLarge( <mask> const Char* const data, const size_t size) { <mask> // Large strings are allocated differently <mask> size_t effectiveCapacity = size; <mask> auto const newRC = RefCounted::create(data, &effectiveCapacity); <mask> ml_.data_ = newRC->data_; <mask> ml_.size_ = size; </s> [sdk33] Update iOS with RN 0.59 </s> remove const Char* const data, const size_t size) { </s> add const Char* const data, const size_t size) { </s> remove const Char* const data, const size_t size) { </s> add const Char* const data, const size_t size) { </s> remove size_t minCapacity, const bool disableSSO) { </s> add size_t minCapacity, const bool disableSSO) { </s> remove static RefCounted * create(const Char * data, size_t * size) { </s> add static RefCounted* create(const Char* data, size_t* size) { </s> remove ml_.data_, ml_.size_, ml_.capacity(), minCapacity); </s> add ml_.data_, ml_.size_, ml_.capacity(), &minCapacity); </s> remove static RefCounted * reallocate(Char *const data, const size_t currentSize, const size_t currentCapacity, const size_t newCapacity) { FBSTRING_ASSERT(newCapacity > 0 && newCapacity > currentSize); </s> add static RefCounted* reallocate( Char* const data, const size_t currentSize, const size_t currentCapacity, size_t* newCapacity) { FBSTRING_ASSERT(*newCapacity > 0 && *newCapacity > currentSize); const size_t allocNewCapacity = goodMallocSize(getDataOffset() + (*newCapacity + 1) * sizeof(Char));
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> // String is not shared, so let's try to realloc (if needed) <mask> if (minCapacity > ml_.capacity()) { <mask> // Asking for more memory <mask> auto const newRC = RefCounted::reallocate( <mask> ml_.data_, ml_.size_, ml_.capacity(), minCapacity); <mask> ml_.data_ = newRC->data_; <mask> ml_.setCapacity(minCapacity, Category::isLarge); <mask> } <mask> FBSTRING_ASSERT(capacity() >= minCapacity); <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove const Char* const data, const size_t size) { </s> add const Char* const data, const size_t size) { </s> remove for (; in != end && out >= lastConstructed; --in, --out) { new (out) T(std::move(*in)); } for (; in != end; --in, --out) { *out = std::move(*in); } for (; out >= lastConstructed; --out) { new (out) T(); } </s> add this->moveToUninitialized(begin, begin + pos, out); </s> remove const Char* const data, const size_t size) { </s> add const Char* const data, const size_t size) { </s> remove // We want to make sure the same stuff is uninitialized memory // if we exit via an exception (this is to make sure we provide // the basic exception safety guarantee for insert functions). if (out < lastConstructed) { out = lastConstructed - 1; } for (auto it = out + 1; it != realLast; ++it) { it->~T(); } </s> add out[pos].~T(); </s> remove for (; b >= dest; --b) b->~T(); </s> add for (; b >= dest; --b) { b->~T(); } </s> remove template<class T> typename std::enable_if< !FOLLY_IS_TRIVIALLY_COPYABLE(T) >::type moveObjectsRight(T* first, T* lastConstructed, T* realLast) { if (lastConstructed == realLast) { return; } T* end = first - 1; // Past the end going backwards. T* out = realLast - 1; T* in = lastConstructed - 1; </s> add template <class T, class EmplaceFunc> void moveToUninitializedEmplace( T* begin, T* end, T* out, SizeType pos, EmplaceFunc&& emplaceFunc) { // Must be called first so that if it throws [begin, end) is unmodified. // We have to support the strong exception guarantee for emplace_back(). emplaceFunc(out + pos); // move old elements to the left of the new one
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> template <class Char> <mask> FOLLY_MALLOC_NOINLINE inline void fbstring_core<Char>::reserveSmall( <mask> size_t minCapacity, const bool disableSSO) { <mask> FBSTRING_ASSERT(category() == Category::isSmall); <mask> if (!disableSSO && minCapacity <= maxSmallSize) { <mask> // small <mask> // Nothing to do, everything stays put <mask> } else if (minCapacity <= maxMediumSize) { </s> [sdk33] Update iOS with RN 0.59 </s> remove return begin() <= end() && empty() == (size() == 0) && empty() == (begin() == end()) && size() <= max_size() && capacity() <= max_size() && size() <= capacity() && begin()[size()] == '\0'; </s> add return begin() <= end() && empty() == (size() == 0) && empty() == (begin() == end()) && size() <= max_size() && capacity() <= max_size() && size() <= capacity() && begin()[size()] == '\0'; </s> remove const Char* const data, const size_t size) { </s> add const Char* const data, const size_t size) { </s> remove const Char* const data, const size_t size) { </s> add const Char* const data, const size_t size) { </s> remove enforce(res_arg <= max_size(), std::__throw_length_error, ""); </s> add enforce<std::length_error>(res_arg <= max_size(), ""); </s> remove template <class Ex> bool is_compatible_with() const { if (item_) { return dynamic_cast<const Ex*>(item_.get()); } else if (eptr_) { try { std::rethrow_exception(eptr_); } catch (typename std::decay<Ex>::type&) { return true; } catch (...) { // fall through } } return false; } </s> add [[noreturn]] static void onNoExceptionError(char const* name); </s> remove if (size <= this->capacity()) { </s> add if (newSize <= capacity()) { assert(!insert);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep replace replace replace keep replace replace replace replace replace replace keep keep keep keep
<mask> */ <mask> template <class Char> <mask> class dummy_fbstring_core { <mask> public: <mask> dummy_fbstring_core() { <mask> } <mask> dummy_fbstring_core(const dummy_fbstring_core& another) <mask> : backend_(another.backend_) { <mask> } <mask> dummy_fbstring_core(const Char * s, size_t n) <mask> : backend_(s, n) { <mask> } <mask> void swap(dummy_fbstring_core & rhs) { <mask> backend_.swap(rhs.backend_); <mask> } <mask> const Char * data() const { <mask> return backend_.data(); </s> [sdk33] Update iOS with RN 0.59 </s> remove const Char * data() const { </s> add const Char* data() const { </s> remove Char * data_; </s> add Char* data_; </s> remove template<class SizeType, bool ShouldUseHeap> struct IntegralSizePolicy { typedef SizeType InternalSizeType; IntegralSizePolicy() : size_(0) {} protected: static constexpr std::size_t policyMaxSize() { return SizeType(~kExternMask); } std::size_t doSize() const { return size_ & ~kExternMask; } std::size_t isExtern() const { return kExternMask & size_; } void setExtern(bool b) { if (b) { size_ |= kExternMask; } else { size_ &= ~kExternMask; } } void setSize(std::size_t sz) { assert(sz <= policyMaxSize()); size_ = (kExternMask & size_) | SizeType(sz); } void swapSizePolicy(IntegralSizePolicy& o) { std::swap(size_, o.size_); } protected: static bool const kShouldUseHeap = ShouldUseHeap; private: static SizeType const kExternMask = kShouldUseHeap ? SizeType(1) << (sizeof(SizeType) * 8 - 1) : 0; </s> add template <class SizeType> struct IntegralSizePolicy<SizeType, false> : public IntegralSizePolicyBase<SizeType, false> { public: template <class T> void moveToUninitialized(T* /*first*/, T* /*last*/, T* /*out*/) { assume_unreachable(); } template <class T, class EmplaceFunc> void moveToUninitializedEmplace( T* /* begin */, T* /* end */, T* /* out */, SizeType /* pos */, EmplaceFunc&& /* emplaceFunc */) { assume_unreachable(); } }; </s> remove : store_(s, n) { } </s> add : store_(s, n) {} </s> remove const Char* const data, const size_t size) { </s> add const Char* const data, const size_t size) {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> void swap(dummy_fbstring_core & rhs) { <mask> backend_.swap(rhs.backend_); <mask> } <mask> const Char * data() const { <mask> return backend_.data(); <mask> } <mask> Char* mutableData() { <mask> return const_cast<Char*>(backend_.data()); <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove : backend_(another.backend_) { } dummy_fbstring_core(const Char * s, size_t n) : backend_(s, n) { } void swap(dummy_fbstring_core & rhs) { </s> add : backend_(another.backend_) {} dummy_fbstring_core(const Char* s, size_t n) : backend_(s, n) {} void swap(dummy_fbstring_core& rhs) { </s> remove Char * data_; </s> add Char* data_; </s> remove bool fullyLinked() const { return getFlags() & FULLY_LINKED; } bool markedForRemoval() const { return getFlags() & MARKED_FOR_REMOVAL; } bool isHeadNode() const { return getFlags() & IS_HEAD_NODE; } </s> add bool fullyLinked() const { return getFlags() & FULLY_LINKED; } bool markedForRemoval() const { return getFlags() & MARKED_FOR_REMOVAL; } bool isHeadNode() const { return getFlags() & IS_HEAD_NODE; } </s> remove value_type& data() { return data_; } const value_type& data() const { return data_; } int maxLayer() const { return height_ - 1; } int height() const { return height_; } </s> add value_type& data() { return data_; } const value_type& data() const { return data_; } int maxLayer() const { return height_ - 1; } int height() const { return height_; } </s> remove iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> add iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> remove setFlags(getFlags() | IS_HEAD_NODE); </s> add setFlags(uint16_t(getFlags() | IS_HEAD_NODE));
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> void reserve(size_t minCapacity) { <mask> backend_.reserve(minCapacity); <mask> } <mask> <mask> private: <mask> std::basic_string<Char> backend_; <mask> }; <mask> #endif // !_LIBSTDCXX_FBSTRING <mask> <mask> /** </s> [sdk33] Update iOS with RN 0.59 </s> remove NodeAlloc& alloc() { return alloc_; } </s> add NodeAlloc& alloc() { return alloc_; } </s> remove std::string what_; </s> add </s> remove void increment() { node_ = node_->next(); }; bool equal(const csl_iterator& other) const { return node_ == other.node_; } value_type& dereference() const { return node_->data(); } </s> add void increment() { node_ = node_->next(); } bool equal(const csl_iterator& other) const { return node_ == other.node_; } value_type& dereference() const { return node_->data(); } </s> remove std::string what_; </s> add </s> remove /** * Returns the current time in seconds since Epoch. */ static double defaultClockNow() noexcept(noexcept(Impl::defaultClockNow())) { return Impl::defaultClockNow(); } </s> add </s> remove private: </s> add private:
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep replace replace replace replace keep keep replace replace replace replace keep
<mask> #else <mask> template <typename E, <mask> class T = std::char_traits<E>, <mask> class A = std::allocator<E>, <mask> class Storage = fbstring_core<E> > <mask> #endif <mask> class basic_fbstring { <mask> static void enforce( <mask> bool condition, <mask> void (*throw_exc)(const char*), <mask> const char* msg) { <mask> if (!condition) { </s> [sdk33] Update iOS with RN 0.59 </s> remove throw_exc(msg); </s> add throw_exception<Ex>(static_cast<Args&&>(args)...); </s> remove template<class OutputValueType, class Delim, class String, class OutputIterator> void splitTo(const Delim& delimiter, const String& input, OutputIterator out, bool ignoreEmpty) { </s> add template < class OutputValueType, class Delim, class String, class OutputIterator> void splitTo( const Delim& delimiter, const String& input, OutputIterator out, bool ignoreEmpty) { </s> remove void join(const Delim& delimiter, Iterator begin, Iterator end, String& output) { detail::internalJoin( detail::prepareDelim(delimiter), begin, end, output); </s> add void join( const Delim& delimiter, Iterator begin, Iterator end, String& output) { detail::internalJoin(detail::prepareDelim(delimiter), begin, end, output); </s> remove template<class Delim, class String, class OutputType> void split(const Delim& delimiter, const String& input, std::vector<OutputType>& out, bool ignoreEmpty) { </s> add template <class Delim, class String, class OutputType> void split( const Delim& delimiter, const String& input, std::vector<OutputType>& out, bool ignoreEmpty) { </s> remove template<class Delim, class String, class OutputType> void split(const Delim& delimiter, const String& input, fbvector<OutputType>& out, bool ignoreEmpty) { </s> add template <class Delim, class String, class OutputType> void split( const Delim& delimiter, const String& input, fbvector<OutputType>& out, bool ignoreEmpty) {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep replace keep keep keep keep replace replace replace replace replace replace replace replace keep keep keep
<mask> if (!condition) { <mask> throw_exc(msg); <mask> } <mask> } <mask> <mask> bool isSane() const { <mask> return <mask> begin() <= end() && <mask> empty() == (size() == 0) && <mask> empty() == (begin() == end()) && <mask> size() <= max_size() && <mask> capacity() <= max_size() && <mask> size() <= capacity() && <mask> begin()[size()] == '\0'; <mask> } <mask> <mask> struct Invariant { </s> [sdk33] Update iOS with RN 0.59
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> typedef typename A::const_pointer const_pointer; <mask> <mask> typedef E* iterator; <mask> typedef const E* const_iterator; <mask> typedef std::reverse_iterator<iterator <mask> #ifdef NO_ITERATOR_TRAITS <mask> , value_type <mask> #endif <mask> > reverse_iterator; <mask> typedef std::reverse_iterator<const_iterator <mask> #ifdef NO_ITERATOR_TRAITS <mask> , const value_type <mask> #endif <mask> > const_reverse_iterator; <mask> <mask> static constexpr size_type npos = size_type(-1); <mask> typedef std::true_type IsRelocatable; <mask> <mask> private: </s> [sdk33] Update iOS with RN 0.59 </s> remove typedef std::size_t size_type; typedef Value value_type; typedef value_type& reference; typedef value_type const& const_reference; typedef value_type* iterator; typedef value_type const* const_iterator; typedef std::ptrdiff_t difference_type; typedef std::reverse_iterator<iterator> reverse_iterator; </s> add typedef std::size_t size_type; typedef Value value_type; typedef value_type& reference; typedef value_type const& const_reference; typedef value_type* iterator; typedef value_type* pointer; typedef value_type const* const_iterator; typedef std::ptrdiff_t difference_type; typedef std::reverse_iterator<iterator> reverse_iterator; </s> remove private: </s> add private: </s> remove : slHolder_(std::move(skip_list)) { </s> add : slHolder_(std::move(skip_list)) { </s> remove sizeof(value_type) * MaxInline, alignof(value_type) >::type InlineStorageDataType; #endif </s> add sizeof(value_type) * MaxInline, alignof(value_type)>::type InlineStorageDataType; </s> remove typedef T value_type; </s> add typedef T value_type; </s> remove #if (FOLLY_X64 || FOLLY_PPC64) typedef unsigned char InlineStorageDataType[sizeof(value_type) * MaxInline]; #else </s> add
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> static constexpr size_type npos = size_type(-1); <mask> typedef std::true_type IsRelocatable; <mask> <mask> private: <mask> static void procrustes(size_type& n, size_type nmax) { <mask> if (n > nmax) { <mask> n = nmax; <mask> } <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove typedef std::reverse_iterator<iterator #ifdef NO_ITERATOR_TRAITS , value_type #endif > reverse_iterator; typedef std::reverse_iterator<const_iterator #ifdef NO_ITERATOR_TRAITS , const value_type #endif > const_reverse_iterator; </s> add typedef std::reverse_iterator<iterator> reverse_iterator; typedef std::reverse_iterator<const_iterator> const_reverse_iterator; </s> remove size_type capacity() const { return store_.capacity(); } </s> add size_type capacity() const { return store_.capacity(); } </s> remove basic_fbstring(const basic_fbstring& str, size_type pos, size_type n = npos, const A& /* a */ = A()) { </s> add basic_fbstring( const basic_fbstring& str, size_type pos, size_type n = npos, const A& /* a */ = A()) { </s> remove basic_fbstring(value_type *s, size_type n, size_type c, AcquireMallocatedString a) : store_(s, n, c, a) { } </s> add basic_fbstring( value_type* s, size_type n, size_type c, AcquireMallocatedString a) : store_(s, n, c, a) {} </s> remove void makeSize(size_type size, value_type* v, size_type pos) { if (size > this->max_size()) { </s> add template <typename EmplaceFunc> void makeSizeInternal( size_type newSize, bool insert, EmplaceFunc&& emplaceFunc, size_type pos) { if (newSize > max_size()) { </s> remove iterator insertImpl(iterator pos, size_type n, const value_type& val, std::true_type) { </s> add iterator insertImpl(iterator pos, size_type n, const value_type& val, std::true_type) {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> static size_type traitsLength(const value_type* s); <mask> <mask> public: <mask> // C++11 21.4.2 construct/copy/destroy <mask> <mask> // Note: while the following two constructors can be (and previously were) <mask> // collapsed into one constructor written this way: <mask> // </s> [sdk33] Update iOS with RN 0.59 </s> remove public: exception_wrapper() = default; // Implicitly construct an exception_wrapper from a qualifying exception. // See the optimize struct for details. template <typename Ex, typename = typename std::enable_if<optimize<typename std::decay<Ex>::type>::value> ::type> /* implicit */ exception_wrapper(Ex&& exn) { typedef typename std::decay<Ex>::type DEx; item_ = std::make_shared<DEx>(std::forward<Ex>(exn)); throwfn_ = folly::detail::Thrower<DEx>::doThrow; } </s> add #define FOLLY_REQUIRES(...) FOLLY_REQUIRES_DEF(__VA_ARGS__) = __LINE__ </s> remove basic_fbstring(value_type *s, size_type n, size_type c, AcquireMallocatedString a) : store_(s, n, c, a) { } </s> add basic_fbstring( value_type* s, size_type n, size_type c, AcquireMallocatedString a) : store_(s, n, c, a) {} </s> remove : store_(b, e - b) { } </s> add : store_(b, size_type(e - b)) {} </s> remove size_type length() const { return size(); } </s> add size_type length() const { return size(); } </s> remove size_type size() const { return store_.size(); } </s> add size_type size() const { return store_.size(); } </s> remove // The following two constructors are meant to emulate the behavior of // try_and_catch in performance sensitive code as well as to be flexible // enough to wrap exceptions of unknown type. There is an overload that // takes an exception reference so that the wrapper can extract and store // the exception's type and what() when possible. // // The canonical use case is to construct an all-catching exception wrapper // with minimal overhead like so: // // try { // // some throwing code // } catch (const std::exception& e) { // // won't lose e's type and what() // exception_wrapper ew{std::current_exception(), e}; // } catch (...) { // // everything else // exception_wrapper ew{std::current_exception()}; // } // // try_and_catch is cleaner and preferable. Use it unless you're sure you need // something like this instead. template <typename Ex> explicit exception_wrapper(std::exception_ptr eptr, Ex& exn) { assign_eptr(eptr, exn); } </s> add namespace exception_wrapper_detail {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace replace keep keep keep keep keep
<mask> // <mask> // if used in a struct which is default-initialized. Hence the split into <mask> // these two separate constructors. <mask> <mask> basic_fbstring() noexcept : basic_fbstring(A()) { <mask> } <mask> <mask> explicit basic_fbstring(const A&) noexcept { <mask> } <mask> <mask> basic_fbstring(const basic_fbstring& str) </s> [sdk33] Update iOS with RN 0.59 </s> remove explicit basic_fbstring(const A&) noexcept { } </s> add explicit basic_fbstring(const A&) noexcept {} </s> remove basic_fbstring(const basic_fbstring& str) : store_(str.store_) { } </s> add basic_fbstring(const basic_fbstring& str) : store_(str.store_) {} </s> remove /* implicit */ basic_fbstring(const std::string& str) : store_(str.data(), str.size()) { } </s> add template <typename A2> /* implicit */ basic_fbstring(const std::basic_string<E, T, A2>& str) : store_(str.data(), str.size()) {} </s> remove : store_(std::move(goner.store_)) { } </s> add : store_(std::move(goner.store_)) {} </s> remove basic_fbstring(const basic_fbstring& str, size_type pos, size_type n = npos, const A& /* a */ = A()) { </s> add basic_fbstring( const basic_fbstring& str, size_type pos, size_type n = npos, const A& /* a */ = A()) { </s> remove void push_back(const value_type c) { // primitive </s> add void push_back(const value_type c) { // primitive
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep replace replace keep keep keep keep keep keep keep keep replace replace replace keep keep keep keep
<mask> } <mask> <mask> explicit basic_fbstring(const A&) noexcept { <mask> } <mask> <mask> basic_fbstring(const basic_fbstring& str) <mask> : store_(str.store_) { <mask> } <mask> <mask> explicit basic_fbstring(const A&) noexcept { <mask> } <mask> <mask> basic_fbstring(const basic_fbstring& str) <mask> : store_(str.store_) { <mask> } <mask> <mask> // Move constructor <mask> basic_fbstring(basic_fbstring&& goner) noexcept <mask> : store_(std::move(goner.store_)) { </s> [sdk33] Update iOS with RN 0.59 </s> remove basic_fbstring() noexcept : basic_fbstring(A()) { } </s> add basic_fbstring() noexcept : basic_fbstring(A()) {} </s> remove : store_(std::move(goner.store_)) { } </s> add : store_(std::move(goner.store_)) {} </s> remove /* implicit */ basic_fbstring(const std::string& str) : store_(str.data(), str.size()) { } </s> add template <typename A2> /* implicit */ basic_fbstring(const std::basic_string<E, T, A2>& str) : store_(str.data(), str.size()) {} </s> remove basic_fbstring(const basic_fbstring& str, size_type pos, size_type n = npos, const A& /* a */ = A()) { </s> add basic_fbstring( const basic_fbstring& str, size_type pos, size_type n = npos, const A& /* a */ = A()) { </s> remove void push_back(const value_type c) { // primitive </s> add void push_back(const value_type c) { // primitive
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep replace replace keep keep keep replace replace replace keep keep keep
<mask> basic_fbstring(basic_fbstring&& goner) noexcept <mask> : store_(std::move(goner.store_)) { <mask> } <mask> <mask> #ifndef _LIBSTDCXX_FBSTRING <mask> // This is defined for compatibility with std::string <mask> /* implicit */ basic_fbstring(const std::string& str) <mask> : store_(str.data(), str.size()) { <mask> } <mask> #endif <mask> <mask> basic_fbstring(const basic_fbstring& str, </s> [sdk33] Update iOS with RN 0.59 </s> remove basic_fbstring(const basic_fbstring& str) : store_(str.store_) { } </s> add basic_fbstring(const basic_fbstring& str) : store_(str.store_) {} </s> remove basic_fbstring(const basic_fbstring& str, size_type pos, size_type n = npos, const A& /* a */ = A()) { </s> add basic_fbstring( const basic_fbstring& str, size_type pos, size_type n = npos, const A& /* a */ = A()) { </s> remove explicit basic_fbstring(const A&) noexcept { } </s> add explicit basic_fbstring(const A&) noexcept {} </s> remove basic_fbstring() noexcept : basic_fbstring(A()) { } </s> add basic_fbstring() noexcept : basic_fbstring(A()) {} </s> remove basic_fbstring & operator=(const std::string & rhs) { </s> add template <typename A2> basic_fbstring& operator=(const std::basic_string<E, T, A2>& rhs) {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> : store_(str.data(), str.size()) { <mask> } <mask> #endif <mask> <mask> basic_fbstring(const basic_fbstring& str, <mask> size_type pos, <mask> size_type n = npos, <mask> const A& /* a */ = A()) { <mask> assign(str, pos, n); <mask> } <mask> <mask> FOLLY_MALLOC_NOINLINE <mask> /* implicit */ basic_fbstring(const value_type* s, const A& /*a*/ = A()) </s> [sdk33] Update iOS with RN 0.59 </s> remove /* implicit */ basic_fbstring(const std::string& str) : store_(str.data(), str.size()) { } </s> add template <typename A2> /* implicit */ basic_fbstring(const std::basic_string<E, T, A2>& str) : store_(str.data(), str.size()) {} </s> remove : store_(s, n) { } </s> add : store_(s, n) {} </s> remove : store_(b, e - b) { } </s> add : store_(b, size_type(e - b)) {} </s> remove : store_(std::move(goner.store_)) { } </s> add : store_(std::move(goner.store_)) {} </s> remove const A>::type& /*a*/ = A()) { </s> add const A>::type& /*a*/ = A()) { </s> remove basic_fbstring(const basic_fbstring& str) : store_(str.store_) { } </s> add basic_fbstring(const basic_fbstring& str) : store_(str.store_) {}
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace replace keep keep keep keep keep
<mask> : store_(s, traitsLength(s)) {} <mask> <mask> FOLLY_MALLOC_NOINLINE <mask> basic_fbstring(const value_type* s, size_type n, const A& /*a*/ = A()) <mask> : store_(s, n) { <mask> } <mask> <mask> FOLLY_MALLOC_NOINLINE <mask> basic_fbstring(size_type n, value_type c, const A& /*a*/ = A()) { <mask> auto const pData = store_.expandNoinit(n); <mask> fbstring_detail::podFill(pData, pData + n, c); </s> [sdk33] Update iOS with RN 0.59 </s> remove : store_(b, e - b) { } </s> add : store_(b, size_type(e - b)) {} </s> remove basic_fbstring(const basic_fbstring& str, size_type pos, size_type n = npos, const A& /* a */ = A()) { </s> add basic_fbstring( const basic_fbstring& str, size_type pos, size_type n = npos, const A& /* a */ = A()) { </s> remove basic_fbstring(value_type *s, size_type n, size_type c, AcquireMallocatedString a) : store_(s, n, c, a) { } </s> add basic_fbstring( value_type* s, size_type n, size_type c, AcquireMallocatedString a) : store_(s, n, c, a) {} </s> remove const A>::type& /*a*/ = A()) { </s> add const A>::type& /*a*/ = A()) { </s> remove iterator insertImpl(iterator pos, size_type n, const value_type& val, std::true_type) { </s> add iterator insertImpl(iterator pos, size_type n, const value_type& val, std::true_type) { </s> remove size_type capacity() const { return store_.capacity(); } </s> add size_type capacity() const { return store_.capacity(); }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> InIt begin, <mask> InIt end, <mask> typename std::enable_if< <mask> !std::is_same<InIt, value_type*>::value, <mask> const A>::type& /*a*/ = A()) { <mask> assign(begin, end); <mask> } <mask> <mask> // Specialization for const char*, const char* <mask> FOLLY_MALLOC_NOINLINE </s> [sdk33] Update iOS with RN 0.59 </s> remove : store_(b, e - b) { } </s> add : store_(b, size_type(e - b)) {} </s> remove : store_(s, n) { } </s> add : store_(s, n) {} </s> remove basic_fbstring(const basic_fbstring& str, size_type pos, size_type n = npos, const A& /* a */ = A()) { </s> add basic_fbstring( const basic_fbstring& str, size_type pos, size_type n = npos, const A& /* a */ = A()) { </s> remove typename std::enable_if<!IsSizableStringContainerIterator<Iterator>::value>::type internalJoin(Delim delimiter, Iterator begin, Iterator end, String& output) { </s> add typename std::enable_if< !IsSizableStringContainerIterator<Iterator>::value>::type internalJoin(Delim delimiter, Iterator begin, Iterator end, String& output) { </s> remove if (std::is_same<Delim, StringPiece>::value && delimSize(delimiter) == 1) { </s> add if (std::is_same<Delim, StringPiece>::value && delimSize(delimiter) == 1) { </s> remove void join(const Delim& delimiter, Iterator begin, Iterator end, String& output) { detail::internalJoin( detail::prepareDelim(delimiter), begin, end, output); </s> add void join( const Delim& delimiter, Iterator begin, Iterator end, String& output) { detail::internalJoin(detail::prepareDelim(delimiter), begin, end, output);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace replace keep keep replace replace replace replace keep keep
<mask> <mask> // Specialization for const char*, const char* <mask> FOLLY_MALLOC_NOINLINE <mask> basic_fbstring(const value_type* b, const value_type* e, const A& /*a*/ = A()) <mask> : store_(b, e - b) { <mask> } <mask> <mask> // Nonstandard constructor <mask> basic_fbstring(value_type *s, size_type n, size_type c, <mask> AcquireMallocatedString a) <mask> : store_(s, n, c, a) { <mask> } <mask> <mask> // Construction from initialization list </s> [sdk33] Update iOS with RN 0.59 </s> remove : store_(s, n) { } </s> add : store_(s, n) {} </s> remove basic_fbstring(const basic_fbstring& str, size_type pos, size_type n = npos, const A& /* a */ = A()) { </s> add basic_fbstring( const basic_fbstring& str, size_type pos, size_type n = npos, const A& /* a */ = A()) { </s> remove const A>::type& /*a*/ = A()) { </s> add const A>::type& /*a*/ = A()) { </s> remove iterator insertImpl(iterator pos, size_type n, const value_type& val, std::true_type) { </s> add iterator insertImpl(iterator pos, size_type n, const value_type& val, std::true_type) { </s> remove size_type capacity() const { return store_.capacity(); } </s> add size_type capacity() const { return store_.capacity(); }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep replace keep keep keep keep replace replace keep keep keep keep
<mask> <mask> #ifndef _LIBSTDCXX_FBSTRING <mask> // Compatibility with std::string <mask> basic_fbstring & operator=(const std::string & rhs) { <mask> return assign(rhs.data(), rhs.size()); <mask> } <mask> <mask> // Compatibility with std::string <mask> std::string toStdString() const { <mask> return std::string(data(), size()); <mask> } <mask> #else <mask> // A lot of code in fbcode still uses this method, so keep it here for now. <mask> const basic_fbstring& toStdString() const { </s> [sdk33] Update iOS with RN 0.59 </s> remove inline std::string toStdString(const folly::fbstring& s) { </s> add inline std::string toStdString(const folly::fbstring& s) { </s> remove : store_(std::move(goner.store_)) { } </s> add : store_(std::move(goner.store_)) {} </s> add #include <folly/Traits.h> </s> remove /* implicit */ basic_fbstring(const std::string& str) : store_(str.data(), str.size()) { } </s> add template <typename A2> /* implicit */ basic_fbstring(const std::basic_string<E, T, A2>& str) : store_(str.data(), str.size()) {} </s> remove std::string join(const Delim& delimiter, const std::initializer_list<Value>& values) { </s> add std::string join( const Delim& delimiter, const std::initializer_list<Value>& values) {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> basic_fbstring& operator=(const value_type* s) { <mask> return assign(s); <mask> } <mask> <mask> basic_fbstring& operator=(value_type c); <mask> <mask> basic_fbstring& operator=(std::initializer_list<value_type> il) { <mask> return assign(il.begin(), il.end()); <mask> } <mask> </s> [sdk33] Update iOS with RN 0.59 </s> remove void push_back(const value_type c) { // primitive </s> add void push_back(const value_type c) { // primitive </s> remove template<class InputIterator> </s> add template <class InputIterator> </s> remove basic_fbstring & operator=(const std::string & rhs) { </s> add template <typename A2> basic_fbstring& operator=(const std::basic_string<E, T, A2>& rhs) { </s> remove enforce(n < size(), std::__throw_out_of_range, ""); </s> add enforce<std::out_of_range>(n < size(), ""); </s> remove basic_fbstring(const basic_fbstring& str) : store_(str.store_) { } </s> add basic_fbstring(const basic_fbstring& str) : store_(str.store_) {} </s> remove basic_fbstring(const basic_fbstring& str, size_type pos, size_type n = npos, const A& /* a */ = A()) { </s> add basic_fbstring( const basic_fbstring& str, size_type pos, size_type n = npos, const A& /* a */ = A()) {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> const_iterator end() const { <mask> return store_.data() + store_.size(); <mask> } <mask> <mask> const_iterator cend() const { return end(); } <mask> <mask> reverse_iterator rbegin() { <mask> return reverse_iterator(end()); <mask> } <mask> </s> [sdk33] Update iOS with RN 0.59 </s> remove reverse_iterator rbegin() { return reverse_iterator(end()); } reverse_iterator rend() { return reverse_iterator(begin()); } </s> add reverse_iterator rbegin() { return reverse_iterator(end()); } reverse_iterator rend() { return reverse_iterator(begin()); } </s> remove iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> add iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> remove iterator end() const { return iterator(nullptr); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> add iterator end() const { return iterator(nullptr); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> remove template<typename U, typename=typename std::enable_if<std::is_convertible<U, T>::value>::type> </s> add template < typename U, typename = typename std::enable_if<std::is_convertible<U, T>::value>::type> </s> remove size_type size() const { return this->doSize(); } bool empty() const { return !size(); } </s> add size_type size() const { return this->doSize(); } bool empty() const { return !size(); } </s> remove iterator end() { return iterator(this, capacity_); } const_iterator end() const { return const_iterator(this, capacity_); } </s> add iterator end() { return iterator(this, capacity_); } const_iterator end() const { return const_iterator(this, capacity_); }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> const_reverse_iterator rbegin() const { <mask> return const_reverse_iterator(end()); <mask> } <mask> <mask> const_reverse_iterator crbegin() const { return rbegin(); } <mask> <mask> reverse_iterator rend() { <mask> return reverse_iterator(begin()); <mask> } <mask> </s> [sdk33] Update iOS with RN 0.59 </s> remove reverse_iterator rbegin() { return reverse_iterator(end()); } reverse_iterator rend() { return reverse_iterator(begin()); } </s> add reverse_iterator rbegin() { return reverse_iterator(end()); } reverse_iterator rend() { return reverse_iterator(begin()); } </s> remove const_reverse_iterator crbegin() const { return rbegin(); } const_reverse_iterator crend() const { return rend(); } </s> add const_reverse_iterator crbegin() const { return rbegin(); } const_reverse_iterator crend() const { return rend(); } </s> remove iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> add iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> remove const_reverse_iterator crend() const { return rend(); } </s> add const_reverse_iterator crend() const { return rend(); } </s> remove const_iterator cend() const { return end(); } </s> add const_iterator cend() const { return end(); } </s> remove const value_type& front() const { return *begin(); } </s> add const value_type& front() const { return *begin(); }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep replace keep keep keep replace keep keep
<mask> <mask> const_reverse_iterator crend() const { return rend(); } <mask> <mask> // Added by C++11 <mask> // C++11 21.4.5, element access: <mask> const value_type& front() const { return *begin(); } <mask> const value_type& back() const { <mask> FBSTRING_ASSERT(!empty()); </s> [sdk33] Update iOS with RN 0.59 </s> remove value_type& front() { return *begin(); } </s> add value_type& front() { return *begin(); } </s> remove reference front() { assert(!empty()); return *begin(); } reference back() { assert(!empty()); return *(end() - 1); } const_reference front() const { assert(!empty()); return *begin(); } const_reference back() const { assert(!empty()); return *(end() - 1); } </s> add reference front() { assert(!empty()); return *begin(); } reference back() { assert(!empty()); return *(end() - 1); } const_reference front() const { assert(!empty()); return *begin(); } const_reference back() const { assert(!empty()); return *(end() - 1); } </s> remove const_reverse_iterator crbegin() const { return rbegin(); } const_reverse_iterator crend() const { return rend(); } </s> add const_reverse_iterator crbegin() const { return rbegin(); } const_reverse_iterator crend() const { return rend(); } </s> remove void clear() { resize(0); } </s> add void clear() { resize(0); } </s> remove bool empty() const { return size() == 0; } </s> add bool empty() const { return size() == 0; }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> FBSTRING_ASSERT(!empty()); <mask> // Should be begin()[size() - 1], but that branches twice <mask> return *(end() - 1); <mask> } <mask> value_type& front() { return *begin(); } <mask> value_type& back() { <mask> FBSTRING_ASSERT(!empty()); <mask> // Should be begin()[size() - 1], but that branches twice <mask> return *(end() - 1); <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove const value_type& front() const { return *begin(); } </s> add const value_type& front() const { return *begin(); } </s> remove reference front() { assert(!empty()); return *begin(); } reference back() { assert(!empty()); return *(end() - 1); } const_reference front() const { assert(!empty()); return *begin(); } const_reference back() const { assert(!empty()); return *(end() - 1); } </s> add reference front() { assert(!empty()); return *begin(); } reference back() { assert(!empty()); return *(end() - 1); } const_reference front() const { assert(!empty()); return *begin(); } const_reference back() const { assert(!empty()); return *(end() - 1); } </s> remove const_reverse_iterator crend() const { return rend(); } </s> add const_reverse_iterator crend() const { return rend(); } </s> remove value_type& data() { return data_; } const value_type& data() const { return data_; } int maxLayer() const { return height_ - 1; } int height() const { return height_; } </s> add value_type& data() { return data_; } const value_type& data() const { return data_; } int maxLayer() const { return height_ - 1; } int height() const { return height_; } </s> remove private: /* * This is doing the same like emplace_back, but we need this helper * to catch the special case - see the next overload function.. */ template<class ...Args> void emplaceBack(Args&&... args) { makeSize(size() + 1); new (end()) value_type(std::forward<Args>(args)...); this->setSize(size() + 1); } </s> add private: </s> remove return numEntries_.readFull() - numErases_.load(std::memory_order_relaxed); </s> add return numEntries_.readFull() - numErases_.load(std::memory_order_relaxed);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> store_.shrink(1); <mask> } <mask> <mask> // C++11 21.4.4 capacity: <mask> size_type size() const { return store_.size(); } <mask> <mask> size_type length() const { return size(); } <mask> <mask> size_type max_size() const { <mask> return std::numeric_limits<size_type>::max(); </s> [sdk33] Update iOS with RN 0.59 </s> remove size_type length() const { return size(); } </s> add size_type length() const { return size(); } </s> remove bool empty() const { return sl_->size() == 0; } size_t size() const { return sl_->size(); } size_type max_size() const { return std::numeric_limits<size_type>::max(); } </s> add bool empty() const { return sl_->size() == 0; } size_t size() const { return sl_->size(); } size_type max_size() const { return std::numeric_limits<size_type>::max(); } </s> remove size_type size() const { return this->doSize(); } bool empty() const { return !size(); } </s> add size_type size() const { return this->doSize(); } bool empty() const { return !size(); } </s> remove iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> add iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> remove size_type count(const key_type &data) const { return contains(data); } </s> add const_iterator find(const key_type& value) const { return iterator(sl_->find(value)); } size_type count(const key_type& data) const { return contains(data); } </s> remove size_type capacity() const { return store_.capacity(); } </s> add size_type capacity() const { return store_.capacity(); }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> // C++11 21.4.4 capacity: <mask> size_type size() const { return store_.size(); } <mask> <mask> size_type length() const { return size(); } <mask> <mask> size_type max_size() const { <mask> return std::numeric_limits<size_type>::max(); <mask> } <mask> </s> [sdk33] Update iOS with RN 0.59 </s> remove size_type size() const { return store_.size(); } </s> add size_type size() const { return store_.size(); } </s> remove bool empty() const { return sl_->size() == 0; } size_t size() const { return sl_->size(); } size_type max_size() const { return std::numeric_limits<size_type>::max(); } </s> add bool empty() const { return sl_->size() == 0; } size_t size() const { return sl_->size(); } size_type max_size() const { return std::numeric_limits<size_type>::max(); } </s> remove size_type size() const { return this->doSize(); } bool empty() const { return !size(); } </s> add size_type size() const { return this->doSize(); } bool empty() const { return !size(); } </s> remove iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> add iterator begin() { return data(); } iterator end() { return data() + size(); } const_iterator begin() const { return data(); } const_iterator end() const { return data() + size(); } const_iterator cbegin() const { return begin(); } const_iterator cend() const { return end(); } </s> remove size_type count(const key_type &data) const { return contains(data); } </s> add const_iterator find(const key_type& value) const { return iterator(sl_->find(value)); } size_type count(const key_type& data) const { return contains(data); } </s> remove size_type capacity() const { return store_.capacity(); } </s> add size_type capacity() const { return store_.capacity(); }
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> void resize(size_type n, value_type c = value_type()); <mask> <mask> size_type capacity() const { return store_.capacity(); } <mask> <mask> void reserve(size_type res_arg = 0) { <mask> enforce(res_arg <= max_size(), std::__throw_length_error, ""); <mask> store_.reserve(res_arg); <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove enforce(res_arg <= max_size(), std::__throw_length_error, ""); </s> add enforce<std::length_error>(res_arg <= max_size(), ""); </s> remove return begin() <= end() && empty() == (size() == 0) && empty() == (begin() == end()) && size() <= max_size() && capacity() <= max_size() && size() <= capacity() && begin()[size()] == '\0'; </s> add return begin() <= end() && empty() == (size() == 0) && empty() == (begin() == end()) && size() <= max_size() && capacity() <= max_size() && size() <= capacity() && begin()[size()] == '\0'; </s> remove void doConstruct(size_type n, value_type const& val) { </s> add template <typename InitFunc> void doConstruct(size_type n, InitFunc&& func) { </s> remove detail::populateMemForward(data(), n, [&] (void* p) { new (p) value_type(val); } ); </s> add detail::populateMemForward(data(), n, std::forward<InitFunc>(func)); </s> remove return *u.getCapacity(); </s> add return u.getCapacity(); </s> remove private: </s> add private:
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> size_type capacity() const { return store_.capacity(); } <mask> <mask> void reserve(size_type res_arg = 0) { <mask> enforce(res_arg <= max_size(), std::__throw_length_error, ""); <mask> store_.reserve(res_arg); <mask> } <mask> <mask> void shrink_to_fit() { <mask> // Shrink only if slack memory is sufficiently large </s> [sdk33] Update iOS with RN 0.59 </s> remove size_type capacity() const { return store_.capacity(); } </s> add size_type capacity() const { return store_.capacity(); } </s> remove return begin() <= end() && empty() == (size() == 0) && empty() == (begin() == end()) && size() <= max_size() && capacity() <= max_size() && size() <= capacity() && begin()[size()] == '\0'; </s> add return begin() <= end() && empty() == (size() == 0) && empty() == (begin() == end()) && size() <= max_size() && capacity() <= max_size() && size() <= capacity() && begin()[size()] == '\0'; </s> remove return *u.getCapacity(); </s> add return u.getCapacity(); </s> remove void makeSize(size_type size, value_type* v = nullptr) { makeSize(size, v, size - 1); </s> add void makeSize(size_type newSize) { makeSizeInternal(newSize, false, [](void*) { assume_unreachable(); }, 0); } template <typename EmplaceFunc> void makeSize(size_type newSize, EmplaceFunc&& emplaceFunc, size_type pos) { assert(size() == capacity()); makeSizeInternal( newSize, true, std::forward<EmplaceFunc>(emplaceFunc), pos); </s> remove enforce(n <= size(), std::__throw_out_of_range, ""); </s> add enforce<std::out_of_range>(n < size(), ""); </s> remove if (size <= this->capacity()) { </s> add if (newSize <= capacity()) { assert(!insert);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep replace keep
<mask> } <mask> basic_fbstring(cbegin(), cend()).swap(*this); <mask> } <mask> <mask> void clear() { resize(0); } <mask> <mask> bool empty() const { return size() == 0; } <mask> </s> [sdk33] Update iOS with RN 0.59 </s> remove bool empty() const { return size() == 0; } </s> add bool empty() const { return size() == 0; } </s> remove bool empty() const { return sl_->size() == 0; } size_t size() const { return sl_->size(); } size_type max_size() const { return std::numeric_limits<size_type>::max(); } </s> add bool empty() const { return sl_->size() == 0; } size_t size() const { return sl_->size(); } size_type max_size() const { return std::numeric_limits<size_type>::max(); } </s> remove size_type size() const { return this->doSize(); } bool empty() const { return !size(); } </s> add size_type size() const { return this->doSize(); } bool empty() const { return !size(); } </s> remove return numEntries_.readFull() - numErases_.load(std::memory_order_relaxed); </s> add return numEntries_.readFull() - numErases_.load(std::memory_order_relaxed); </s> remove return begin() <= end() && empty() == (size() == 0) && empty() == (begin() == end()) && size() <= max_size() && capacity() <= max_size() && size() <= capacity() && begin()[size()] == '\0'; </s> add return begin() <= end() && empty() == (size() == 0) && empty() == (begin() == end()) && size() <= max_size() && capacity() <= max_size() && size() <= capacity() && begin()[size()] == '\0';
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep replace keep keep keep keep replace
<mask> <mask> const_reference at(size_type n) const { <mask> enforce(n <= size(), std::__throw_out_of_range, ""); <mask> return (*this)[n]; <mask> } <mask> <mask> reference at(size_type n) { <mask> enforce(n < size(), std::__throw_out_of_range, ""); </s> [sdk33] Update iOS with RN 0.59 </s> remove std::__throw_out_of_range("index out of range"); </s> add throw_exception<std::out_of_range>("index out of range"); </s> remove std::__throw_out_of_range("index out of range"); </s> add throw_exception<std::out_of_range>("index out of range"); </s> remove enforce(res_arg <= max_size(), std::__throw_length_error, ""); </s> add enforce<std::length_error>(res_arg <= max_size(), ""); </s> remove reference front() { assert(!empty()); return *begin(); } reference back() { assert(!empty()); return *(end() - 1); } const_reference front() const { assert(!empty()); return *begin(); } const_reference back() const { assert(!empty()); return *(end() - 1); } </s> add reference front() { assert(!empty()); return *begin(); } reference back() { assert(!empty()); return *(end() - 1); } const_reference front() const { assert(!empty()); return *begin(); } const_reference back() const { assert(!empty()); return *(end() - 1); } </s> remove detail::populateMemForward(begin() + size(), sz - size(), [&] (void* p) { new (p) value_type(); } ); </s> add detail::populateMemForward( begin() + size(), sz - size(), [&](void* p) { new (p) value_type(); });
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> basic_fbstring& append(size_type n, value_type c); <mask> <mask> template<class InputIterator> <mask> basic_fbstring& append(InputIterator first, InputIterator last) { <mask> insert(end(), first, last); <mask> return *this; <mask> } <mask> </s> [sdk33] Update iOS with RN 0.59 </s> remove template<class Arg> </s> add template <class Arg> </s> remove void push_back(const value_type c) { // primitive </s> add void push_back(const value_type c) { // primitive </s> remove template<class T> typename std::enable_if< FOLLY_IS_TRIVIALLY_COPYABLE(T) >::type </s> add template <class T> typename std::enable_if<folly::is_trivially_copyable<T>::value>::type </s> remove if (std::is_same<categ,std::input_iterator_tag>::value) { </s> add if (std::is_same<categ, std::input_iterator_tag>::value) { </s> remove if (std::is_same<categ,std::input_iterator_tag>::value) { </s> add if (std::is_same<categ, std::input_iterator_tag>::value) { </s> remove basic_fbstring& operator=(value_type c); </s> add // This actually goes directly against the C++ spec, but the // value_type overload is dangerous, so we're explicitly deleting // any overloads of operator= that could implicitly convert to // value_type. // Note that we do need to explicitly specify the template types because // otherwise MSVC 2017 will aggressively pre-resolve value_type to // traits_type::char_type, which won't compare as equal when determining // which overload the implementation is referring to. // Also note that MSVC 2015 Update 3 requires us to explicitly specify the // namespace in-which to search for basic_fbstring, otherwise it tries to // look for basic_fbstring::basic_fbstring, which is just plain wrong. template <typename TP> typename std::enable_if< std::is_same< typename std::decay<TP>::type, typename folly::basic_fbstring<E, T, A, Storage>::value_type>::value, basic_fbstring<E, T, A, Storage>&>::type operator=(TP c);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> basic_fbstring& append(std::initializer_list<value_type> il) { <mask> return append(il.begin(), il.end()); <mask> } <mask> <mask> void push_back(const value_type c) { // primitive <mask> store_.push_back(c); <mask> } <mask> <mask> basic_fbstring& assign(const basic_fbstring& str) { <mask> if (&str == this) return *this; </s> [sdk33] Update iOS with RN 0.59 </s> remove basic_fbstring(const basic_fbstring& str) : store_(str.store_) { } </s> add basic_fbstring(const basic_fbstring& str) : store_(str.store_) {} </s> remove template<class InputIterator> </s> add template <class InputIterator> </s> remove enforce(n < size(), std::__throw_out_of_range, ""); </s> add enforce<std::out_of_range>(n < size(), ""); </s> remove explicit basic_fbstring(const A&) noexcept { } </s> add explicit basic_fbstring(const A&) noexcept {} </s> remove basic_fbstring() noexcept : basic_fbstring(A()) { } </s> add basic_fbstring() noexcept : basic_fbstring(A()) {} </s> remove basic_fbstring & operator=(const std::string & rhs) { </s> add template <typename A2> basic_fbstring& operator=(const std::basic_string<E, T, A2>& rhs) {
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBString.h
keep keep keep keep replace keep keep keep keep keep
<mask> try { <mask> for (; b != e; ++b) S_construct(b); <mask> } catch (...) { <mask> --b; <mask> for (; b >= dest; --b) b->~T(); <mask> throw; <mask> } <mask> } <mask> } <mask> </s> [sdk33] Update iOS with RN 0.59 </s> remove size_t len = e - b; </s> add size_t len = size_t(e - b); </s> remove for (; in != end && out >= lastConstructed; --in, --out) { new (out) T(std::move(*in)); } for (; in != end; --in, --out) { *out = std::move(*in); } for (; out >= lastConstructed; --out) { new (out) T(); } </s> add this->moveToUninitialized(begin, begin + pos, out); </s> remove // move old elements to the left of the new one try { detail::moveToUninitialized(begin(), begin() + pos, newp); } catch (...) { newp[pos].~value_type(); free(newh); throw; } // move old elements to the right of the new one try { if (pos < size-1) { detail::moveToUninitialized(begin() + pos, end(), newp + pos + 1); } } catch (...) { for (size_type i = 0; i <= pos; ++i) { newp[i].~value_type(); } free(newh); throw; } } else { // move without inserting new element try { detail::moveToUninitialized(begin(), end(), newp); } catch (...) { free(newh); throw; </s> add try { if (insert) { // move and insert the new element this->moveToUninitializedEmplace( begin(), end(), newp, pos, std::forward<EmplaceFunc>(emplaceFunc)); } else { // move without inserting new element this->moveToUninitialized(begin(), end(), newp); </s> remove for (; e_ != &accessor_->meta_.head_ && !valid(); e_ = e_->next) { } </s> add for (; e_ != &accessor_->meta_.head_.elements[accessor_->id_].node && !valid(); e_ = e_->getNext()) { } </s> remove } // anonymous namespace </s> add } // namespace </s> remove // We want to make sure the same stuff is uninitialized memory // if we exit via an exception (this is to make sure we provide // the basic exception safety guarantee for insert functions). if (out < lastConstructed) { out = lastConstructed - 1; } for (auto it = out + 1; it != realLast; ++it) { it->~T(); } </s> add out[pos].~T();
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FBVector.h
keep keep keep keep replace replace keep keep keep keep keep
<mask> * but the latter is cleaner. <mask> */ <mask> template <class Container> <mask> Formatter<true, Container> vformat(StringPiece fmt, Container&& container) { <mask> return Formatter<true, Container>( <mask> fmt, std::forward<Container>(container)); <mask> } <mask> <mask> /** <mask> * Like vformat(), but immediately returns the formatted string instead of an <mask> * intermediate format object. </s> [sdk33] Update iOS with RN 0.59 </s> remove Formatter<true, Container> vformatChecked(StringPiece fmt, Container&& container) { </s> add Formatter<true, Container> vformatChecked( StringPiece fmt, Container&& container) { </s> remove } // namespace folly </s> add } // namespace folly </s> remove * template<class Container> </s> add * template <class Container> </s> remove std::string join(const Delim& delimiter, const Container& container) { </s> add std::string join(const Delim& delimiter, const Container& container) { </s> remove FOLLY_PRINTF_FORMAT_ATTR(1, 2); </s> add FOLLY_PRINTF_FORMAT_ATTR(1, 2); </s> remove std::string& stringAppendf(std::string* output, FOLLY_PRINTF_FORMAT const char* format, ...) FOLLY_PRINTF_FORMAT_ATTR(2, 3); </s> add std::string& stringAppendf( std::string* output, FOLLY_PRINTF_FORMAT const char* format, ...) FOLLY_PRINTF_FORMAT_ATTR(2, 3);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/Format.h
keep replace keep replace replace replace
<mask> namespace detail { <mask> template <class Container, class Value> struct DefaultValueWrapper { <mask> DefaultValueWrapper(const Container& container, const Value& defaultValue) <mask> : container(container), <mask> defaultValue(defaultValue) { <mask> } </s> [sdk33] Update iOS with RN 0.59 </s> remove } // namespace </s> add } // namespace detail </s> remove detail::DefaultValueWrapper<Container, Value> defaulted(const Container& c, const Value& v) { </s> add detail::DefaultValueWrapper<Container, Value> defaulted( const Container& c, const Value& v) { </s> remove void join(const Delim& delimiter, const Container& container, String& output) { </s> add void join(const Delim& delimiter, const Container& container, String& output) { </s> remove void join(const Delim& delimiter, Iterator begin, Iterator end, String& output); </s> add void join(const Delim& delimiter, Iterator begin, Iterator end, String& output); </s> remove : public IndexableTraitsSeq<small_vector<T, M, A, B, C>> { }; </s> add : public IndexableTraitsSeq<small_vector<T, M, A, B, C>> {}; } // namespace detail
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/Format.h
keep replace keep keep replace replace
<mask> }; <mask> } // namespace <mask> <mask> template <class Container, class Value> <mask> detail::DefaultValueWrapper<Container, Value> <mask> defaulted(const Container& c, const Value& v) { </s> [sdk33] Update iOS with RN 0.59 </s> remove : container(container), defaultValue(defaultValue) { } </s> add : container(container), defaultValue(defaultValue) {} </s> remove template <class Container, class Value> struct DefaultValueWrapper { </s> add template <class Container, class Value> struct DefaultValueWrapper { </s> remove void join(const Delim& delimiter, const Container& container, String& output) { </s> add void join(const Delim& delimiter, const Container& container, String& output) { </s> remove std::string join(const Delim& delimiter, const std::initializer_list<Value>& values) { </s> add std::string join( const Delim& delimiter, const std::initializer_list<Value>& values) { </s> remove void join(const Delim& delimiter, Iterator begin, Iterator end, String& output); </s> add void join(const Delim& delimiter, Iterator begin, Iterator end, String& output);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/Format.h
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> * arg.precision, as that has a different meaning for numbers (not "maximum <mask> * field width") <mask> */ <mask> template <class FormatCallback> <mask> void formatNumber(StringPiece val, int prefixLen, FormatArg& arg, <mask> FormatCallback& cb); <mask> <mask> <mask> /** <mask> * Format a Formatter object recursively. Behaves just like <mask> * formatString(fmt.str(), arg, cb); but avoids creating a temporary <mask> * string if possible. </s> [sdk33] Update iOS with RN 0.59 </s> remove template <class FormatCallback, class Derived, bool containerMode, class... Args> </s> add template < class FormatCallback, class Derived, bool containerMode, class... Args> </s> remove } // namespace format_value </s> add } // namespace format_value </s> add /** * Disambiguate the name var by concatenating the line number of the original * point of expansion. This avoids shadowing warnings for nested * SYNCHRONIZEDs. The name is consistent if used multiple times within * another macro. * Only for internal use. */ #define SYNCHRONIZED_VAR(var) FB_CONCATENATE(SYNCHRONIZED_##var##_, __LINE__) </s> remove * TODO: Extend acquireLocked() with variadic template versions that * allow for more than 2 Synchronized arguments. (I haven't given too much * thought about how to implement this. It seems like it would be rather * complicated, but I think it should be possible.) </s> add * use lock() with folly::wlock(), folly::rlock() and folly::ulock() for * arbitrary locking without causing a deadlock (as much as possible), with the * same effects as std::lock() </s> remove * Note that the move constructor may throw because it acquires a lock. * Since the move constructor is not declared noexcept, when objects of this * class are used as elements in a vector or a similar container. The * elements might not be moved around when resizing. They might be copied * instead. You have been warned. </s> add * Semantically, assumes that the source object is a true rvalue and therefore * that no synchronization is required for accessing it. </s> remove * Constructs a new `Function` from any callable object. This * handles function pointers, pointers to static member functions, * `std::reference_wrapper` objects, `std::function` objects, and arbitrary * objects that implement `operator()` if the parameter signature * matches (i.e. it returns R when called with Args...). * For a `Function` with a const function type, the object must be * callable from a const-reference, i.e. implement `operator() const`. * For a `Function` with a non-const function type, the object will * be called from a non-const reference, which means that it will execute * a non-const `operator()` if it is defined, and falls back to * `operator() const` otherwise. </s> add * Constructs a new `Function` from any callable object that is _not_ a * `folly::Function`. This handles function pointers, pointers to static * member functions, `std::reference_wrapper` objects, `std::function` * objects, and arbitrary objects that implement `operator()` if the parameter * signature matches (i.e. it returns an object convertible to `R` when called * with `Args...`).
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/Format.h
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> * Format a Formatter object recursively. Behaves just like <mask> * formatString(fmt.str(), arg, cb); but avoids creating a temporary <mask> * string if possible. <mask> */ <mask> template <class FormatCallback, <mask> class Derived, <mask> bool containerMode, <mask> class... Args> <mask> void formatFormatter( <mask> const BaseFormatter<Derived, containerMode, Args...>& formatter, <mask> FormatArg& arg, <mask> FormatCallback& cb); <mask> </s> [sdk33] Update iOS with RN 0.59 </s> remove void formatNumber(StringPiece val, int prefixLen, FormatArg& arg, FormatCallback& cb); </s> add void formatNumber( StringPiece val, int prefixLen, FormatArg& arg, FormatCallback& cb); </s> remove } // namespace format_value </s> add } // namespace format_value </s> remove template<class Delim, class String, class OutputType> void split(const Delim& delimiter, const String& input, std::vector<OutputType>& out, const bool ignoreEmpty = false); template<class Delim, class String, class OutputType> void split(const Delim& delimiter, const String& input, folly::fbvector<OutputType>& out, const bool ignoreEmpty = false); template<class OutputValueType, class Delim, class String, class OutputIterator> void splitTo(const Delim& delimiter, const String& input, OutputIterator out, const bool ignoreEmpty = false); </s> add template <class Delim, class String, class OutputType> void split( const Delim& delimiter, const String& input, std::vector<OutputType>& out, const bool ignoreEmpty = false); template <class Delim, class String, class OutputType> void split( const Delim& delimiter, const String& input, folly::fbvector<OutputType>& out, const bool ignoreEmpty = false); template < class OutputValueType, class Delim, class String, class OutputIterator> void splitTo( const Delim& delimiter, const String& input, OutputIterator out, const bool ignoreEmpty = false); </s> remove template <class String1, class String2> void backslashify(const String1& input, String2& output, bool hex_style=false); </s> add template <class OutputString> void backslashify( folly::StringPiece input, OutputString& output, bool hex_style = false); </s> add #if __OBJC__ // Make sure Objective C blocks are copied template <class ReturnType, class... Args> /* implicit */ Function& operator=(ReturnType (^objCBlock)(Args... args)) { (*this) = [blockCopy = (ReturnType(^)(Args...))[objCBlock copy]]( Args... args) { return blockCopy(args...); }; return *this; } #endif </s> remove output = folly::to<OutputType>(input); </s> add toOrIgnore(input, output);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/Format.h
keep keep keep keep replace keep keep keep keep keep
<mask> const BaseFormatter<Derived, containerMode, Args...>& formatter, <mask> FormatArg& arg, <mask> FormatCallback& cb); <mask> <mask> } // namespace format_value <mask> <mask> /* <mask> * Specialize folly::FormatValue for your type. <mask> * <mask> * FormatValue<T> is constructed with a (reference-collapsed) T&&, which is </s> [sdk33] Update iOS with RN 0.59 </s> remove template <class FormatCallback, class Derived, bool containerMode, class... Args> </s> add template < class FormatCallback, class Derived, bool containerMode, class... Args> </s> remove void formatNumber(StringPiece val, int prefixLen, FormatArg& arg, FormatCallback& cb); </s> add void formatNumber( StringPiece val, int prefixLen, FormatArg& arg, FormatCallback& cb); </s> remove /* </s> add /** </s> remove template <typename Fun> /* implicit */ FunctionRef(Fun&& fun) noexcept { using ReferencedType = typename std::remove_reference<Fun>::type; static_assert( std::is_convertible< typename std::result_of<ReferencedType&(Args && ...)>::type, ReturnType>::value, "FunctionRef cannot be constructed from object with " "incompatible function signature"); // `Fun` may be a const type, in which case we have to do a const_cast // to store the address in a `void*`. This is safe because the `void*` // will be cast back to `Fun*` (which is a const pointer whenever `Fun` // is a const type) inside `FunctionRef::call` object_ = const_cast<void*>(static_cast<void const*>(std::addressof(fun))); call_ = &FunctionRef::call<ReferencedType>; } </s> add template < typename Fun, typename std::enable_if< Conjunction< Negation<std::is_same<FunctionRef, _t<std::decay<Fun>>>>, is_invocable_r<ReturnType, Fun&&, Args&&...>>::value, int>::type = 0> constexpr /* implicit */ FunctionRef(Fun&& fun) noexcept // `Fun` may be a const type, in which case we have to do a const_cast // to store the address in a `void*`. This is safe because the `void*` // will be cast back to `Fun*` (which is a const pointer whenever `Fun` // is a const type) inside `FunctionRef::call` : object_( const_cast<void*>(static_cast<void const*>(std::addressof(fun)))), call_(&FunctionRef::call<Fun>) {} </s> remove /* * Throwing exceptions can be a convenient way to handle errors. Storing * exceptions in an exception_ptr makes it easy to handle exceptions in a * different thread or at a later time. exception_ptr can also be used in a very * generic result/exception wrapper. * * However, there are some issues with throwing exceptions and * std::exception_ptr. These issues revolve around throw being expensive, * particularly in a multithreaded environment (see * ExceptionWrapperBenchmark.cpp). * * Imagine we have a library that has an API which returns a result/exception * wrapper. Let's consider some approaches for implementing this wrapper. * First, we could store a std::exception. This approach loses the derived * exception type, which can make exception handling more difficult for users * that prefer rethrowing the exception. We could use a folly::dynamic for every * possible type of exception. This is not very flexible - adding new types of * exceptions requires a change to the result/exception wrapper. We could use an * exception_ptr. However, constructing an exception_ptr as well as accessing * the error requires a call to throw. That means that there will be two calls * to throw in order to process the exception. For performance sensitive * applications, this may be unacceptable. * * exception_wrapper is designed to handle exception management for both * convenience and high performance use cases. make_exception_wrapper is * templated on derived type, allowing us to rethrow the exception properly for * users that prefer convenience. These explicitly named exception types can * therefore be handled without any peformance penalty. exception_wrapper is * also flexible enough to accept any type. If a caught exception is not of an * explicitly named type, then std::exception_ptr is used to preserve the * exception state. For performance sensitive applications, the accessor methods * can test or extract a pointer to a specific exception type with very little * overhead. * * Example usage: * * exception_wrapper globalExceptionWrapper; * * // Thread1 * void doSomethingCrazy() { * int rc = doSomethingCrazyWithLameReturnCodes(); * if (rc == NAILED_IT) { * globalExceptionWrapper = exception_wrapper(); * } else if (rc == FACE_PLANT) { * globalExceptionWrapper = make_exception_wrapper<FacePlantException>(); * } else if (rc == FAIL_WHALE) { * globalExceptionWrapper = make_exception_wrapper<FailWhaleException>(); * } * } * * // Thread2: Exceptions are ok! * void processResult() { * try { * globalExceptionWrapper.throwException(); * } catch (const FacePlantException& e) { * LOG(ERROR) << "FACEPLANT!"; * } catch (const FailWhaleException& e) { * LOG(ERROR) << "FAILWHALE!"; * } * } * * // Thread2: Exceptions are bad! * void processResult() { * globalExceptionWrapper.with_exception( * [&](FacePlantException& faceplant) { * LOG(ERROR) << "FACEPLANT"; * }) || * globalExceptionWrapper.with_exception( * [&](FailWhaleException& failwhale) { * LOG(ERROR) << "FAILWHALE!"; * }) || * LOG(FATAL) << "Unrecognized exception"; * } * */ class exception_wrapper { protected: template <typename Ex> struct optimize; </s> add #define FOLLY_REQUIRES_DEF(...) \ _t<std::enable_if<static_cast<bool>(__VA_ARGS__), long>> </s> remove * acquisition is unsuccessful, the returned LockedPtr is NULL. </s> add * acquisition is unsuccessful, the returned LockedPtr is nullptr.
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/Format.h
keep keep keep keep replace keep keep keep keep keep
<mask> T, <mask> typename std::enable_if< <mask> std::is_same<typename T::IsFormatter, detail::FormatterTag>::value>:: <mask> type> : public std::true_type {}; <mask> } // folly::detail <mask> <mask> // Deprecated API. formatChecked() et. al. now behave identically to their <mask> // non-Checked counterparts. <mask> template <class... Args> <mask> Formatter<false, Args...> formatChecked(StringPiece fmt, Args&&... args) { </s> [sdk33] Update iOS with RN 0.59 </s> remove throwSystemErrorExplicit( err, to<fbstring>(std::forward<Args>(args)...).c_str()); </s> add throw makeSystemErrorExplicit(err, std::forward<Args>(args)...); </s> remove template<class ...Args> </s> add template <class... Args> </s> remove // Invoke helper template <typename F, typename... Args> inline auto invoke(F&& f, Args&&... args) -> decltype(std::forward<F>(f)(std::forward<Args>(args)...)) { return std::forward<F>(f)(std::forward<Args>(args)...); } template <typename M, typename C, typename... Args> inline auto invoke(M(C::*d), Args&&... args) -> decltype(std::mem_fn(d)(std::forward<Args>(args)...)) { return std::mem_fn(d)(std::forward<Args>(args)...); } </s> add </s> remove throw std::system_error(err, std::system_category(), msg); </s> add throw makeSystemErrorExplicit(err, msg); </s> remove template <class SynchronizedType, class LockPolicy> class LockedGuardPtr { private: // CDataType is the DataType with the appropriate const-qualification using CDataType = detail::SynchronizedDataType<SynchronizedType>; public: using DataType = typename SynchronizedType::DataType; using MutexType = typename SynchronizedType::MutexType; using Synchronized = typename std::remove_const<SynchronizedType>::type; LockedGuardPtr() = delete; /** * Takes a Synchronized<T> and locks it. */ explicit LockedGuardPtr(SynchronizedType* parent) : parent_(parent) { LockPolicy::lock(parent_->mutex_); } /** * Destructor releases. */ ~LockedGuardPtr() { LockPolicy::unlock(parent_->mutex_); } /** * Access the locked data. */ CDataType* operator->() const { return &parent_->datum_; } </s> add template <typename D, typename M, typename... Args> auto wlock(Synchronized<D, M>& synchronized, Args&&... args) { return detail::wlock(synchronized, std::forward<Args>(args)...); } template <typename Data, typename Mutex, typename... Args> auto rlock(const Synchronized<Data, Mutex>& synchronized, Args&&... args) { return detail::rlock(synchronized, std::forward<Args>(args)...); } template <typename D, typename M, typename... Args> auto ulock(Synchronized<D, M>& synchronized, Args&&... args) { return detail::ulock(synchronized, std::forward<Args>(args)...); } template <typename D, typename M, typename... Args> auto lock(Synchronized<D, M>& synchronized, Args&&... args) { return detail::lock(synchronized, std::forward<Args>(args)...); } template <typename D, typename M, typename... Args> auto lock(const Synchronized<D, M>& synchronized, Args&&... args) { return detail::lock(synchronized, std::forward<Args>(args)...); } </s> remove throwSystemErrorExplicit(-ret, std::forward<Args>(args)...); </s> add throwSystemErrorExplicit(int(-ret), std::forward<Args>(args)...);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/Format.h
keep keep keep keep replace replace keep keep keep keep keep
<mask> inline std::string sformatChecked(StringPiece fmt, Args&&... args) { <mask> return formatChecked(fmt, std::forward<Args>(args)...).str(); <mask> } <mask> template <class Container> <mask> Formatter<true, Container> vformatChecked(StringPiece fmt, <mask> Container&& container) { <mask> return vformat(fmt, std::forward<Container>(container)); <mask> } <mask> template <class Container> <mask> inline std::string svformatChecked(StringPiece fmt, Container&& container) { <mask> return vformatChecked(fmt, std::forward<Container>(container)).str(); </s> [sdk33] Update iOS with RN 0.59 </s> remove return Formatter<true, Container>( fmt, std::forward<Container>(container)); </s> add return Formatter<true, Container>(fmt, std::forward<Container>(container)); </s> remove std::string join(const Delim& delimiter, const Container& container) { </s> add std::string join(const Delim& delimiter, const Container& container) { </s> remove } // namespace folly </s> add } // namespace folly </s> remove void join(const Delim& delimiter, const std::initializer_list<Value>& values, String& output) { </s> add void join( const Delim& delimiter, const std::initializer_list<Value>& values, String& output) { </s> remove * template<class Container> </s> add * template <class Container> </s> remove "invalid format argument {", fullArgString, "}: ", std::forward<Args>(args)...); </s> add "invalid format argument {", fullArgString, "}: ", std::forward<Args>(args)...);
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/Format.h
keep keep keep keep replace keep keep keep replace
<mask> vformatChecked(Str* out, StringPiece fmt, Container&& container) { <mask> vformatChecked(fmt, std::forward<Container>(container)).appendTo(*out); <mask> } <mask> <mask> } // namespace folly <mask> <mask> #include <folly/Format-inl.h> <mask> <mask> #pragma GCC diagnostic pop </s> [sdk33] Update iOS with RN 0.59 </s> remove Formatter<true, Container> vformatChecked(StringPiece fmt, Container&& container) { </s> add Formatter<true, Container> vformatChecked( StringPiece fmt, Container&& container) { </s> remove } // namespace folly </s> add FOLLY_POP_WARNING </s> remove #pragma GCC diagnostic pop </s> add #undef FOLLY_SV_PACK_ATTR #undef FOLLY_SV_PACK_PUSH #undef FOLLY_SV_PACK_POP </s> remove } // namespace detail </s> add } // namespace folly </s> remove #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wshadow" </s> add FOLLY_PUSH_WARNING FOLLY_GNU_DISABLE_WARNING("-Wshadow")
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/Format.h
keep replace keep keep keep keep keep
<mask> /* <mask> * Copyright 2016 Facebook, Inc. <mask> * <mask> * Licensed under the Apache License, Version 2.0 (the "License"); <mask> * you may not use this file except in compliance with the License. <mask> * You may obtain a copy of the License at <mask> * </s> [sdk33] Update iOS with RN 0.59
https://github.com/expo/expo/commit/6de1d01531ce3e3388db436409963b83ec2f7911
ios/Pods/Folly/folly/FormatArg.h