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

This commit is contained in:
hjk
2011-05-16 14:07:10 +02:00
parent dd3900a402
commit 185aaa7e26
2 changed files with 3 additions and 8 deletions

View File

@@ -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):

View File

@@ -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):