some optimize

This commit is contained in:
blueloveTH 2024-02-01 13:43:47 +08:00
parent b1f93cfc72
commit 3d7024b508

View File

@ -7,7 +7,7 @@ namespace pkpy{
// Skip utf8 BOM if there is any. // Skip utf8 BOM if there is any.
if (strncmp(source.data(), "\xEF\xBB\xBF", 3) == 0) index += 3; if (strncmp(source.data(), "\xEF\xBB\xBF", 3) == 0) index += 3;
// Drop all '\r' // Drop all '\r'
SStream ss; SStream ss(source.size());
while(index < source.size()){ while(index < source.size()){
if(source[index] != '\r') ss << source[index]; if(source[index] != '\r') ss << source[index];
index++; index++;