-#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
- assert(category() == Category::isSmall &&
- static_cast<size_t>(small_[maxSmallSize])
- <= static_cast<size_t>(maxSmallSize));
- return static_cast<size_t>(maxSmallSize)
- - static_cast<size_t>(small_[maxSmallSize]);
-#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
- assert(category() == Category::isSmall &&
- (static_cast<size_t>(small_[maxSmallSize]) >> 2)
- <= static_cast<size_t>(maxSmallSize));
- return static_cast<size_t>(maxSmallSize)
- - (static_cast<size_t>(small_[maxSmallSize]) >> 2);
-#else
-#error Unable to identify target endianness
-#endif
+ assert(category() == Category::isSmall);
+ auto shift = kIsLittleEndian ? 0 : 2;
+ auto smallShifted = static_cast<size_t>(small_[maxSmallSize]) >> shift;
+ assert(static_cast<size_t>(maxSmallSize) >= smallShifted);
+ return static_cast<size_t>(maxSmallSize) - smallShifted;