Bug 2068585 - Get rid of collections.OrderedDict r=xpcom-reviewers,mccr8

dict is ordered since 3.6

Differential Revision: https://phabricator.services.mozilla.com/D322947
This commit is contained in:
serge-sans-paille
2026-09-08 11:08:48 +00:00
committed by sguelton@mozilla.com
parent 0ac379c00d
commit 122a2634c3
2 changed files with 4 additions and 6 deletions
+2 -3
View File
@@ -1,6 +1,5 @@
#!/usr/bin/env python
import json
from collections import OrderedDict
class Mod:
@@ -21,7 +20,7 @@ class Mod:
Mod.active = None
modules = OrderedDict()
modules = {}
# To add error code to your module, you need to do the following:
#
@@ -123,7 +122,7 @@ def SUCCESS(code):
# Errors is an ordered dictionary, so that we can recover the order in which
# they were defined. This is important for determining which name is the
# canonical name for an error code.
errors = OrderedDict()
errors = {}
# Standard "it worked" return value
errors["NS_OK"] = 0
+2 -3
View File
@@ -7,7 +7,6 @@
import functools
import json
from collections import OrderedDict
import buildconfig
from perfecthash import PerfectHash
@@ -208,7 +207,7 @@ def link_to_cpp(interfaces, fd, header_fd):
consts = []
domobjects = []
domobject_cache = {}
strings = OrderedDict()
strings = {}
def lower_uuid(uuid):
return (
@@ -242,7 +241,7 @@ def link_to_cpp(interfaces, fd, header_fd):
# We've already seen this string.
return strings[s]
elif len(strings):
# Get the last string we inserted (should be O(1) on OrderedDict).
# Get the last string we inserted (should be O(1) on dict).
last_s = next(reversed(strings))
strings[s] = strings[last_s] + len(last_s) + 1
else: