Commit 185aaa7e authored by hjk's avatar hjk

debugger: use python's built-in min()

parent dd3900a4
......@@ -83,11 +83,6 @@ def select(condition, if_expr, else_expr):
return if_expr
return else_expr
def qmin(n, m):
if n < m:
return n
return m
def isGoodGdb():
#return gdb.VERSION.startswith("6.8.50.2009") \
# and gdb.VERSION != "6.8.50.20090630-cvs"
......@@ -1463,7 +1458,7 @@ class Dumper:
self.put('%s="%s",' % (name, value))
def childRange(self):
return xrange(qmin(self.currentMaxNumChilds, self.currentNumChilds))
return xrange(min(self.currentMaxNumChilds, self.currentNumChilds))
# Convenience function.
def putItemCount(self, count, maximum = 1000000000):
......
......@@ -454,7 +454,7 @@ def qdump__QList(d, item):
and str(innerType.target().unqualified()) != "char"
if innerTypeIsPointer:
p = gdb.Value(array).cast(innerType.pointer()) + begin
checkPointerRange(p, qmin(size, 100))
checkPointerRange(p, min(size, 100))
d.putItemCount(size)
d.putNumChild(size)
......@@ -1878,7 +1878,7 @@ def qdump__std__string(d, item):
elif str(charType) == "wchar_t":
d.putType("std::wstring", 1)
n = qmin(size, 1000)
n = min(size, 1000)
if charType.sizeof == 1:
format = "%02x"
for i in xrange(size):
......
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