forked from qt-creator/qt-creator
debugger: use python's built-in min()
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user