зеркало из https://github.com/mozilla/pjs.git
API cleanup for nsString
This commit is contained in:
Родитель
86c828c93e
Коммит
aeffd0c992
|
@ -466,7 +466,7 @@ nsFileURL::nsFileURL(const nsString& inString, PRBool inCreateDirs)
|
|||
{
|
||||
const nsAutoCString aString(inString);
|
||||
const char* aCString = (const char*) aString;
|
||||
if (!inString)
|
||||
if (!inString.Length())
|
||||
return;
|
||||
NS_ASSERTION(strstr(aCString, kFileURLPrefix) == aCString, "Not a URL!");
|
||||
// Make canonical and absolute.
|
||||
|
|
|
@ -177,7 +177,7 @@ nsProperties::SetProperty(const nsString& aKey, nsString& aNewValue,
|
|||
PRUint32 hashValue = nsCRT::HashValue(key, &len);
|
||||
PLHashEntry **hep = PL_HashTableRawLookup(mTable, hashValue, key);
|
||||
PLHashEntry *he = *hep;
|
||||
if (he && aOldValue) {
|
||||
if (he && aOldValue.Length()) {
|
||||
// XXX fix me
|
||||
}
|
||||
PL_HashTableRawAdd(mTable, hep, hashValue, aKey.ToNewUnicode(),
|
||||
|
@ -205,7 +205,7 @@ nsProperties::Subclass(nsIProperties* aSubclass)
|
|||
NS_IMETHODIMP
|
||||
nsProperties::GetProperty(const nsString& aKey, nsString& aValue)
|
||||
{
|
||||
const PRUnichar *key = aKey;
|
||||
const PRUnichar *key = aKey.GetUnicode();
|
||||
PRUint32 len;
|
||||
PRUint32 hashValue = nsCRT::HashValue(key, &len);
|
||||
PLHashEntry **hep = PL_HashTableRawLookup(mTable, hashValue, key);
|
||||
|
|
|
@ -177,7 +177,7 @@ nsProperties::SetProperty(const nsString& aKey, nsString& aNewValue,
|
|||
PRUint32 hashValue = nsCRT::HashValue(key, &len);
|
||||
PLHashEntry **hep = PL_HashTableRawLookup(mTable, hashValue, key);
|
||||
PLHashEntry *he = *hep;
|
||||
if (he && aOldValue) {
|
||||
if (he && aOldValue.Length()) {
|
||||
// XXX fix me
|
||||
}
|
||||
PL_HashTableRawAdd(mTable, hep, hashValue, aKey.ToNewUnicode(),
|
||||
|
@ -205,7 +205,7 @@ nsProperties::Subclass(nsIProperties* aSubclass)
|
|||
NS_IMETHODIMP
|
||||
nsProperties::GetProperty(const nsString& aKey, nsString& aValue)
|
||||
{
|
||||
const PRUnichar *key = aKey;
|
||||
const PRUnichar *key = aKey.GetUnicode();
|
||||
PRUint32 len;
|
||||
PRUint32 hashValue = nsCRT::HashValue(key, &len);
|
||||
PLHashEntry **hep = PL_HashTableRawLookup(mTable, hashValue, key);
|
||||
|
|
|
@ -466,7 +466,7 @@ nsFileURL::nsFileURL(const nsString& inString, PRBool inCreateDirs)
|
|||
{
|
||||
const nsAutoCString aString(inString);
|
||||
const char* aCString = (const char*) aString;
|
||||
if (!inString)
|
||||
if (!inString.Length())
|
||||
return;
|
||||
NS_ASSERTION(strstr(aCString, kFileURLPrefix) == aCString, "Not a URL!");
|
||||
// Make canonical and absolute.
|
||||
|
|
Загрузка…
Ссылка в новой задаче