Read about our upcoming Code of Conduct on this issue

Commit a53eed7c authored by Ronan Lamy's avatar Ronan Lamy
Browse files

inline single-use function

parent fffc1c0969ff
......@@ -345,17 +345,6 @@ class SimplePointerRepr(Repr):
# ____________________________________________________________
def inputdesc(reqtype, desc):
"""Return a Constant for the given desc, of the requested type,
which can only be a Repr.
assert isinstance(reqtype, Repr)
value = reqtype.convert_desc(desc)
lltype = reqtype.lowleveltype
c = Constant(value)
c.concretetype = lltype
return c
def inputconst(reqtype, value):
"""Return a Constant with the given value, of the requested type,
which can be a Repr instance or a low-level type.
......@@ -7,7 +7,7 @@ from rpython.rtyper import rclass, callparse
from rpython.rtyper.error import TyperError
from rpython.rtyper.lltypesystem.lltype import typeOf, Void
from rpython.rtyper.rmodel import (Repr, inputconst, CanBeNull, mangle,
inputdesc, warning, impossible_repr)
warning, impossible_repr)
from rpython.tool.pairtype import pair, pairtype
......@@ -495,7 +495,9 @@ class __extend__(pairtype(SingleFrozenPBCRepr, AbstractMultipleFrozenPBCRepr)):
frozendesc1 = r_pbc1.frozendesc
access = frozendesc1.queryattrfamily()
if access is r_pbc2.access_set:
return inputdesc(r_pbc2, frozendesc1)
value = r_pbc2.convert_desc(frozendesc1)
lltype = r_pbc2.lowleveltype
return Constant(value, lltype)
return NotImplemented
class __extend__(pairtype(AbstractMultipleUnrelatedFrozenPBCRepr,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment