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:
parent
1b0af4ba17
commit
51a90159dd
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue