[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <386dceda0e200f141a6b3863c81b795b3530489b.1383221003.git.josh@joshtriplett.org>
Date: Thu, 31 Oct 2013 05:08:07 -0700
From: Josh Triplett <josh@...htriplett.org>
To: Andrew Morton <akpm@...ux-foundation.org>,
Nathan Lynch <ntl@...ox.com>,
Jean Delvare <khali@...ux-fr.org>, linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] scripts/bloat-o-meter: Use .startswith rather than
fragile slicing
str.startswith has existed since at least Python 2.0, in 2000; use it
rather than a fragile comparison against an initial slice of a string,
which requires hard-coding the length of the string to compare against.
Signed-off-by: Josh Triplett <josh@...htriplett.org>
---
scripts/bloat-o-meter | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter
index bf24f50..31c9531 100755
--- a/scripts/bloat-o-meter
+++ b/scripts/bloat-o-meter
@@ -19,7 +19,7 @@ def getsizes(file):
size, type, name = l[:-1].split()
if type in "tTdDbBrR":
# strip generated symbols
- if name[:6] == "__mod_": continue
+ if name.startswith("__mod_"): continue
if name == "linux_banner": continue
# function names begin with '.' on 64-bit powerpc
if "." in name[1:]: name = "static." + name.split(".")[0]
--
1.8.4.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists