Explicit CopyString, remove (const char*) constructors.

This gets rid of the (litstr) StringData and StackStringData
constructors, but keeps String(litstr).  Also rename all
the instances of AttachLiteral to CopyString, since they now
mean the same thing.
Esse commit está contido em:
Edwin Smith
2013-04-24 16:57:54 -07:00
commit de Sara Golemon
commit b7cc57a8db
55 arquivos alterados com 178 adições e 180 exclusões
+3 -3
Ver Arquivo
@@ -106,12 +106,12 @@ StringData* StringData::FindStaticString(const StringData* str) {
}
StringData *StringData::GetStaticString(const std::string &str) {
StackStringData sd(str.c_str(), str.size(), AttachLiteral);
StackStringData sd(str.c_str(), str.size(), CopyString);
return GetStaticString(&sd);
}
StringData *StringData::GetStaticString(const char *str) {
StackStringData sd(str, strlen(str), AttachLiteral);
StackStringData sd(str, strlen(str), CopyString);
return GetStaticString(&sd);
}
@@ -565,7 +565,7 @@ static StringData** precompute_chars() {
StringData** raw = new StringData*[256];
for (int i = 0; i < 256; i++) {
char s[2] = { (char)i, 0 };
StackStringData str(s, 1, AttachLiteral);
StackStringData str(s, 1, CopyString);
raw[i] = StringData::GetStaticString(&str);
}
return raw;