lsmem: improve node lookup

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>
This commit is contained in:
Heiko Carstens 2016-11-04 13:10:06 +01:00 committed by Karel Zak
parent 1b0af4ba17
commit 51a90159dd
1 changed files with 1 additions and 0 deletions

View 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;