Bug 1486690 - Rename NS_str{,}dup and remove unnecessary checks after calls to them. r=glandium

The 'x' prefix makes it clearer that these are infallible.

A couple of nsJSID methods are now also infallible.
This commit is contained in:
Nicholas Nethercote
2018-08-28 15:58:54 +10:00
parent 10ac33fb46
commit beb45f5f20
27 changed files with 50 additions and 62 deletions

View File

@@ -2344,11 +2344,7 @@ nsOfflineCacheDevice::RunSimpleQuery(mozIStorageStatement * statement,
char **ret = static_cast<char **>(moz_xmalloc(*count * sizeof(char*)));
for (uint32_t i = 0; i < *count; i++) {
ret[i] = NS_strdup(valArray[i].get());
if (!ret[i]) {
NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(i, ret);
return NS_ERROR_OUT_OF_MEMORY;
}
ret[i] = NS_xstrdup(valArray[i].get());
}
*values = ret;