зеркало из https://github.com/mozilla/gecko-dev.git
Bug 869836 - Part 8: Use `Append('c')` instead of `Append("c")`. r=ehsan
This commit is contained in:
Родитель
aea8617b92
Коммит
59b969f7f4
|
@ -665,7 +665,7 @@ nsresult ChannelMediaResource::SetupChannelHeaders()
|
|||
} else {
|
||||
rangeString.AppendInt(mOffset);
|
||||
}
|
||||
rangeString.Append("-");
|
||||
rangeString.Append('-');
|
||||
if (!mByteRange.IsNull()) {
|
||||
rangeString.AppendInt(mByteRange.mEnd);
|
||||
}
|
||||
|
|
|
@ -1439,13 +1439,13 @@ void
|
|||
Console::MakeFormatString(nsCString& aFormat, int32_t aInteger,
|
||||
int32_t aMantissa, char aCh)
|
||||
{
|
||||
aFormat.Append("%");
|
||||
aFormat.Append('%');
|
||||
if (aInteger >= 0) {
|
||||
aFormat.AppendInt(aInteger);
|
||||
}
|
||||
|
||||
if (aMantissa >= 0) {
|
||||
aFormat.Append(".");
|
||||
aFormat.Append('.');
|
||||
aFormat.AppendInt(aMantissa);
|
||||
}
|
||||
|
||||
|
|
|
@ -3440,7 +3440,7 @@ nsDOMDeviceStorage::Add(nsIDOMBlob* aBlob, ErrorResult& aRv)
|
|||
|
||||
nsAutoCString path;
|
||||
path.Assign(nsDependentCString(buffer));
|
||||
path.Append(".");
|
||||
path.Append('.');
|
||||
path.Append(extension);
|
||||
|
||||
return AddNamed(aBlob, NS_ConvertASCIItoUTF16(path), aRv);
|
||||
|
|
|
@ -608,10 +608,10 @@ nsPluginStreamListenerPeer::MakeByteRangeString(NPByteRange* aRangeList, nsACStr
|
|||
|
||||
// XXX needs to be fixed for negative offsets
|
||||
string.AppendInt(range->offset);
|
||||
string.Append("-");
|
||||
string.Append('-');
|
||||
string.AppendInt(range->offset + range->length - 1);
|
||||
if (range->next)
|
||||
string += ",";
|
||||
string.Append(',');
|
||||
|
||||
requestCnt++;
|
||||
}
|
||||
|
|
|
@ -2202,7 +2202,7 @@ nsWebBrowserPersist::CalculateAndAppendFileExt(nsIURI *aURI, nsIChannel *aChanne
|
|||
if (newFileName.Length() > diff)
|
||||
newFileName.Truncate(diff);
|
||||
}
|
||||
newFileName.Append(".");
|
||||
newFileName.Append('.');
|
||||
newFileName.Append(fileExt);
|
||||
}
|
||||
|
||||
|
|
|
@ -261,7 +261,7 @@ nsresult nsAutoConfig::downloadAutoConfig()
|
|||
In this case the autoconfig URL is a script and
|
||||
emailAddr as passed as an argument
|
||||
*/
|
||||
mConfigURL.Append("?");
|
||||
mConfigURL.Append('?');
|
||||
mConfigURL.Append(emailAddr);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1205,7 +1205,7 @@ void WriteSnapshotLinkToDumpFile(T* aObj, FILE* aFile)
|
|||
return;
|
||||
}
|
||||
nsCString string(aObj->Name());
|
||||
string.Append("-");
|
||||
string.Append('-');
|
||||
string.AppendInt((uint64_t)aObj);
|
||||
fprintf_stderr(aFile, "href=\"javascript:ViewImage('%s')\"", string.BeginReading());
|
||||
}
|
||||
|
@ -1219,7 +1219,7 @@ void WriteSnapshotToDumpFile_internal(T* aObj, DataSourceSurface* aSurf)
|
|||
aSurf->Stride(),
|
||||
SurfaceFormatToImageFormat(aSurf->GetFormat()));
|
||||
nsCString string(aObj->Name());
|
||||
string.Append("-");
|
||||
string.Append('-');
|
||||
string.AppendInt((uint64_t)aObj);
|
||||
if (gfxUtils::sDumpPaintFile) {
|
||||
fprintf_stderr(gfxUtils::sDumpPaintFile, "array[\"%s\"]=\"", string.BeginReading());
|
||||
|
|
|
@ -130,7 +130,7 @@ public:
|
|||
nsAutoCString path(NS_LITERAL_CSTRING(_path)); \
|
||||
path.AppendLiteral("/("); \
|
||||
path.Append(_uri); \
|
||||
path.Append(")"); \
|
||||
path.Append(')'); \
|
||||
nsresult rv; \
|
||||
rv = callback->Callback(EmptyCString(), path, \
|
||||
KIND_HEAP, UNITS_BYTES, _amount, \
|
||||
|
|
|
@ -2307,7 +2307,7 @@ static void
|
|||
DumpPaintedImage(nsDisplayItem* aItem, gfxASurface* aSurf)
|
||||
{
|
||||
nsCString string(aItem->Name());
|
||||
string.Append("-");
|
||||
string.Append('-');
|
||||
string.AppendInt((uint64_t)aItem);
|
||||
fprintf_stderr(gfxUtils::sDumpPaintFile, "array[\"%s\"]=\"", string.BeginReading());
|
||||
aSurf->DumpAsDataURL(gfxUtils::sDumpPaintFile);
|
||||
|
|
|
@ -153,7 +153,7 @@ PrintDisplayItemTo(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem,
|
|||
}
|
||||
if (aDumpHtml && aItem->Painted()) {
|
||||
nsCString string(aItem->Name());
|
||||
string.Append("-");
|
||||
string.Append('-');
|
||||
string.AppendInt((uint64_t)aItem);
|
||||
str += nsPrintfCString("<a href=\"javascript:ViewImage('%s')\">", string.BeginReading());
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ public:
|
|||
fd = file;
|
||||
}
|
||||
nsCString buf(zip);
|
||||
buf.Append(" ");
|
||||
buf.Append(' ');
|
||||
buf.Append(entry);
|
||||
buf.Append('\n');
|
||||
PR_Write(fd, buf.get(), buf.Length());
|
||||
|
|
|
@ -97,9 +97,9 @@ public:
|
|||
{
|
||||
// TODO: more efficient way to generate hash?
|
||||
nsAutoCString temp(aKey->mBaseDomain);
|
||||
temp.Append("#");
|
||||
temp.Append('#');
|
||||
temp.Append(aKey->mAppId);
|
||||
temp.Append("#");
|
||||
temp.Append('#');
|
||||
temp.Append(aKey->mInBrowserElement ? 1 : 0);
|
||||
return mozilla::HashString(temp);
|
||||
}
|
||||
|
|
|
@ -690,7 +690,7 @@ RDFContainerImpl::GetNextValue(nsIRDFResource** aResult)
|
|||
char buf[sizeof(kRDFNameSpaceURI) + 16];
|
||||
nsFixedCString nextValStr(buf, sizeof(buf), 0);
|
||||
nextValStr = kRDFNameSpaceURI;
|
||||
nextValStr.Append("_");
|
||||
nextValStr.Append('_');
|
||||
nextValStr.AppendInt(nextVal, 10);
|
||||
|
||||
rv = gRDFService->GetResource(nextValStr, aResult);
|
||||
|
|
|
@ -232,14 +232,14 @@ PathifyURI(nsIURI *in, nsACString &out)
|
|||
nsAutoCString path;
|
||||
rv = jarURI->GetJAREntry(path);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
out.Append("/");
|
||||
out.Append('/');
|
||||
out.Append(path);
|
||||
} else { // Very unlikely
|
||||
nsAutoCString spec;
|
||||
rv = uri->GetSpec(spec);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
out.Append("/");
|
||||
out.Append('/');
|
||||
out.Append(spec);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -745,7 +745,7 @@ Connection::databaseElementExists(enum DatabaseElementType aElementType,
|
|||
}
|
||||
query.AppendLiteral("' AND name ='");
|
||||
query.Append(element);
|
||||
query.Append("'");
|
||||
query.Append('\'');
|
||||
|
||||
sqlite3_stmt *stmt;
|
||||
int srv = prepareStatement(mDBConn, query, &stmt);
|
||||
|
|
|
@ -160,7 +160,7 @@ AsyncStatementSpinner::HandleError(mozIStorageError *aError)
|
|||
nsAutoCString warnMsg;
|
||||
warnMsg.AppendLiteral("An error occurred while executing an async statement: ");
|
||||
warnMsg.AppendInt(result);
|
||||
warnMsg.Append(" ");
|
||||
warnMsg.Append(' ');
|
||||
warnMsg.Append(message);
|
||||
NS_WARNING(warnMsg.get());
|
||||
|
||||
|
|
|
@ -284,7 +284,7 @@ PendingDBLookup::LookupSpecInternal(const nsACString& aSpec)
|
|||
nsAutoCString blocklist;
|
||||
Preferences::GetCString(PREF_DOWNLOAD_BLOCK_TABLE, &blocklist);
|
||||
if (!mAllowlistOnly && !blocklist.IsEmpty()) {
|
||||
tables.Append(",");
|
||||
tables.Append(',');
|
||||
tables.Append(blocklist);
|
||||
}
|
||||
return dbService->Lookup(principal, tables, this);
|
||||
|
|
|
@ -52,7 +52,7 @@ AsyncStatementCallback::HandleError(mozIStorageError *aError)
|
|||
nsAutoCString warnMsg;
|
||||
warnMsg.AppendLiteral("An error occurred while executing an async statement: ");
|
||||
warnMsg.AppendInt(result);
|
||||
warnMsg.Append(" ");
|
||||
warnMsg.Append(' ');
|
||||
warnMsg.Append(message);
|
||||
NS_WARNING(warnMsg.get());
|
||||
#endif
|
||||
|
|
|
@ -191,7 +191,7 @@ Classifier::TableRequest(nsACString& aResult)
|
|||
continue;
|
||||
|
||||
aResult.Append(store->TableName());
|
||||
aResult.Append(";");
|
||||
aResult.Append(';');
|
||||
|
||||
ChunkSet &adds = store->AddChunks();
|
||||
ChunkSet &subs = store->SubChunks();
|
||||
|
|
|
@ -394,7 +394,7 @@ LookupCache::GetKey(const nsACString& aSpec,
|
|||
if (IsCanonicalizedIP(host)) {
|
||||
nsAutoCString key;
|
||||
key.Assign(host);
|
||||
key.Append("/");
|
||||
key.Append('/');
|
||||
return aHash->FromPlaintext(key, aCryptoHash);
|
||||
}
|
||||
|
||||
|
@ -409,13 +409,13 @@ LookupCache::GetKey(const nsACString& aSpec,
|
|||
|
||||
if (hostComponents.Length() > 2) {
|
||||
lookupHost.Append(hostComponents[last - 2]);
|
||||
lookupHost.Append(".");
|
||||
lookupHost.Append('.');
|
||||
}
|
||||
|
||||
lookupHost.Append(hostComponents[last - 1]);
|
||||
lookupHost.Append(".");
|
||||
lookupHost.Append('.');
|
||||
lookupHost.Append(hostComponents[last]);
|
||||
lookupHost.Append("/");
|
||||
lookupHost.Append('/');
|
||||
|
||||
return aHash->FromPlaintext(lookupHost, aCryptoHash);
|
||||
}
|
||||
|
|
|
@ -1207,7 +1207,7 @@ nsUrlClassifierDBService::Classify(nsIPrincipal* aPrincipal,
|
|||
nsAutoCString phishing;
|
||||
Preferences::GetCString(PHISH_TABLE_PREF, &phishing);
|
||||
if (!phishing.IsEmpty()) {
|
||||
tables.Append(",");
|
||||
tables.Append(',');
|
||||
tables.Append(phishing);
|
||||
}
|
||||
nsresult rv = LookupURI(aPrincipal, tables, callback, false, result);
|
||||
|
|
|
@ -66,7 +66,7 @@ nsPSPrinterList::GetPrinterList(nsTArray<nsCString>& aList)
|
|||
nsAutoCString fullName(NS_CUPS_PRINTER);
|
||||
fullName.Append(dests[i].name);
|
||||
if (dests[i].instance != nullptr) {
|
||||
fullName.Append("/");
|
||||
fullName.Append('/');
|
||||
fullName.Append(dests[i].instance);
|
||||
}
|
||||
if (dests[i].is_default)
|
||||
|
|
|
@ -261,7 +261,7 @@ private:
|
|||
}
|
||||
processName.AppendLiteral("pid=");
|
||||
processName.Append(pidStr);
|
||||
processName.Append(")");
|
||||
processName.Append(')');
|
||||
|
||||
// Read the PSS values from the smaps file.
|
||||
nsPrintfCString smapsPath("/proc/%s/smaps", pidStr);
|
||||
|
@ -464,14 +464,14 @@ private:
|
|||
|
||||
aName.AppendLiteral("/[");
|
||||
aName.Append(aPerms);
|
||||
aName.Append("]");
|
||||
aName.Append(']');
|
||||
|
||||
// Append the permissions. This is useful for non-verbose mode in
|
||||
// about:memory when the filename is long and goes of the right side of the
|
||||
// window.
|
||||
aDesc.AppendLiteral(" [");
|
||||
aDesc.Append(aPerms);
|
||||
aDesc.Append("]");
|
||||
aDesc.Append(']');
|
||||
}
|
||||
|
||||
nsresult ParseMapBody(
|
||||
|
@ -518,7 +518,7 @@ private:
|
|||
|
||||
nsAutoCString path("mem/processes/");
|
||||
path.Append(aProcessName);
|
||||
path.Append("/");
|
||||
path.Append('/');
|
||||
path.Append(aName);
|
||||
|
||||
REPORT(path, *aPss, aDescription);
|
||||
|
|
Загрузка…
Ссылка в новой задаче