MCPcopy Create free account
hub / github.com/SpartanJ/eepp / isAsciiTpl

Function isAsciiTpl

src/eepp/core/string.cpp:1520–1535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1518
1519template <typename StringType, auto Limit = 127>
1520static 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
1537bool String::isAscii( String::View str ) {
1538 return isAsciiTpl<String::View>( str );

Callers

nothing calls this directly

Calls 4

isAsciiAVX2Function · 0.85
isAsciiNEONFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected