mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Store the arrays of properties as &'static [T] rather than [T, ..N].
This means the .as_slice() call (which is problematic when storing the array in a static struct) is no longer necessary.
This commit is contained in:
parent
f6294a67c5
commit
da28a791e5
1 changed files with 3 additions and 3 deletions
|
@ -1101,9 +1101,9 @@ class PropertyDefiner:
|
||||||
if specTerminator:
|
if specTerminator:
|
||||||
specs.append(specTerminator)
|
specs.append(specTerminator)
|
||||||
|
|
||||||
return (("static %s: [%s, ..%i] = [\n" +
|
return (("static %s: &'static [%s] = &[\n" +
|
||||||
",\n".join(specs) + "\n" +
|
",\n".join(specs) + "\n" +
|
||||||
"];\n\n") % (name, specType, len(specs)))
|
"];\n\n") % (name, specType))
|
||||||
|
|
||||||
# The length of a method is the maximum of the lengths of the
|
# The length of a method is the maximum of the lengths of the
|
||||||
# argument lists of all its overloads.
|
# argument lists of all its overloads.
|
||||||
|
@ -1894,7 +1894,7 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
|
||||||
val = ('%(' + name + ')s') % self.properties.variableNames()
|
val = ('%(' + name + ')s') % self.properties.variableNames()
|
||||||
if val == "ptr::null()":
|
if val == "ptr::null()":
|
||||||
return "None"
|
return "None"
|
||||||
return "Some(%s.as_slice())" % val
|
return "Some(%s)" % val
|
||||||
|
|
||||||
if needInterfaceObject:
|
if needInterfaceObject:
|
||||||
if self.descriptor.interface.ctor():
|
if self.descriptor.interface.ctor():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue