| 1518 | |
| 1519 | template <typename StringType, auto Limit = 127> |
| 1520 | static inline bool isAsciiTpl( const StringType& str ) { |
| 1521 | #ifdef EE_ARCH_X86_64 |
| 1522 | if ( System::CPU::hasAVX2() ) { |
| 1523 | return isAsciiAVX2( (const char32_t*)str.data(), str.size(), Limit ); |
| 1524 | } |
| 1525 | #elif defined( EE_ARCH_ARM64 ) |
| 1526 | if ( System::CPU::hasNEON() ) { |
| 1527 | return isAsciiNEON( (const char32_t*)str.data(), str.size(), Limit ); |
| 1528 | } |
| 1529 | #endif |
| 1530 | |
| 1531 | for ( const auto& codepoint : str ) |
| 1532 | if ( codepoint > Limit ) |
| 1533 | return false; |
| 1534 | return true; |
| 1535 | } |
| 1536 | |
| 1537 | bool String::isAscii( String::View str ) { |
| 1538 | return isAsciiTpl<String::View>( str ); |
nothing calls this directly
no test coverage detected