提交 b4a695a8 authored 作者: Frederic Bastien's avatar Frederic Bastien

Small speed up while cloning PrinterState

上级 ee4c4e21
......@@ -340,7 +340,7 @@ class PrinterState(gof.utils.scratchpad):
def __init__(self, props=None, **more_props):
if props is None:
props = {}
if isinstance(props, gof.utils.scratchpad):
elif isinstance(props, gof.utils.scratchpad):
self.__update__(props)
else:
self.__dict__.update(props)
......@@ -353,7 +353,7 @@ class PrinterState(gof.utils.scratchpad):
def clone(self, props=None, **more_props):
if props is None:
props = {}
return PrinterState(self, **more_props)
return PrinterState(self, **dict(props, **more_props))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论