]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsmem: improve node lookup
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Fri, 4 Nov 2016 12:10:06 +0000 (13:10 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 9 Nov 2016 09:02:32 +0000 (10:02 +0100)
Break the loop as soon as we found the node a memory block belongs to,
it doesn't make sense to continue scanning.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
sys-utils/lsmem.c

index 3599e470daf8f56dac8540f9cf887b2c4113947d..e0de829b4e3d64a29243666dd0bc67a048d4cab5 100644 (file)
@@ -265,6 +265,7 @@ static int memory_block_get_node(char *name)
                if (!isdigit_string(de->d_name + 4))
                        continue;
                node = strtol(de->d_name + 4, NULL, 10);
+               break;
        }
        closedir(dir);
        return node;