Removed unnecessary comments

This commit is contained in:
Xnoe 2020-09-25 07:11:57 +01:00
parent 5cbd8c2ff0
commit be25f0a746

8
utf8.h
View File

@ -10,8 +10,7 @@
class char32 { class char32 {
uint32_t fetch32(char** cstr) { uint32_t fetch32(char** cstr) {
uint32_t r(0); uint32_t r(0);
if (!**cstr) if (!**cstr) return r;
return r;
unsigned char compare = (unsigned char)**cstr; unsigned char compare = (unsigned char)**cstr;
if (compare >> 3 == 0b11110) size = 4; if (compare >> 3 == 0b11110) size = 4;
if (compare >> 4 == 0b1110) size = 3; if (compare >> 4 == 0b1110) size = 3;
@ -20,7 +19,6 @@ class char32 {
int i = size; int i = size;
for (;i>0;i--) { for (;i>0;i--) {
// std::cout << **cstr;
r <<= 8; r <<= 8;
r += (unsigned char)**cstr; r += (unsigned char)**cstr;
(*cstr)++; (*cstr)++;
@ -32,7 +30,6 @@ public:
uint32_t c; uint32_t c;
char32(const char* s) {c = fetch32((char**)&s);} char32(const char* s) {c = fetch32((char**)&s);}
char32(char** s) {c = fetch32(s);} char32(char** s) {c = fetch32(s);}
//char32() {c = 0; size = 1;}
char32(uint32_t s) {c = s;} char32(uint32_t s) {c = s;}
bool operator==(char* cs) {return c==fetch32(&cs);} bool operator==(char* cs) {return c==fetch32(&cs);}
bool operator==(char32 cs) {return c==cs.c;} bool operator==(char32 cs) {return c==cs.c;}
@ -43,7 +40,6 @@ public:
char* toReturn = (char*)calloc(size, 1); char* toReturn = (char*)calloc(size, 1);
for (int i=0;i<size;i++) for (int i=0;i<size;i++)
toReturn[i] = (char)(c>>(8*(size-i-1))); toReturn[i] = (char)(c>>(8*(size-i-1)));
//char* toReturn = (char*)&c;
return toReturn; return toReturn;
} }
@ -283,7 +279,6 @@ struct string32 {
cs.insert(cs.begin()+si, inner.cs.begin(), inner.cs.end()); cs.insert(cs.begin()+si, inner.cs.begin(), inner.cs.end());
rebuildSize(); rebuildSize();
return true; return true;
//return false;
} }
void replaceAroundSelfAsymAll(string32 leftFind, string32 rightFind, string32 leftWith, string32 rightWith) { void replaceAroundSelfAsymAll(string32 leftFind, string32 rightFind, string32 leftWith, string32 rightWith) {
@ -358,3 +353,4 @@ std::ostream& operator<<(std::ostream& stream, const string32& s32) {
stream << s32[i]; stream << s32[i];
return stream; return stream;
} }