Bug 1050035 (part 2) - Remove the fallible version of PL_DHashTableInit(). r=froydnj,mrbkap.
Because it's no longer needed now that entry storage isn't allocated there. (The other possible causes of failures are much less interesting and simply crashing is a reasonable thing to do for them.) This also makes PL_DNewHashTable() infallible.
This commit is contained in:
@@ -83,17 +83,10 @@ nsresult
|
||||
nsHTMLEntities::AddRefTable(void)
|
||||
{
|
||||
if (!gTableRefCnt) {
|
||||
if (!PL_DHashTableInit(&gEntityToUnicode, &EntityToUnicodeOps,
|
||||
sizeof(EntityNodeEntry),
|
||||
fallible, NS_HTML_ENTITY_COUNT)) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
if (!PL_DHashTableInit(&gUnicodeToEntity, &UnicodeToEntityOps,
|
||||
sizeof(EntityNodeEntry),
|
||||
fallible, NS_HTML_ENTITY_COUNT)) {
|
||||
PL_DHashTableFinish(&gEntityToUnicode);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
PL_DHashTableInit(&gEntityToUnicode, &EntityToUnicodeOps,
|
||||
sizeof(EntityNodeEntry), NS_HTML_ENTITY_COUNT);
|
||||
PL_DHashTableInit(&gUnicodeToEntity, &UnicodeToEntityOps,
|
||||
sizeof(EntityNodeEntry), NS_HTML_ENTITY_COUNT);
|
||||
for (const EntityNode *node = gEntityArray,
|
||||
*node_end = ArrayEnd(gEntityArray);
|
||||
node < node_end; ++node) {
|
||||
|
||||
Reference in New Issue
Block a user