Skip to content

Commit

Permalink
libmem: don't fail parsing empty node mask.
Browse files Browse the repository at this point in the history
Signed-off-by: Krisztian Litkey <[email protected]>
  • Loading branch information
klihub committed Oct 14, 2024
1 parent e6ec2b7 commit e2b1f8c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/resmgr/lib/memory/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ func NewNodeMask(ids ...ID) NodeMask {
// ParseNodeMask parses the given string representation of a NodeMask.
func ParseNodeMask(str string) (NodeMask, error) {
m := NodeMask(0)
if str == "" {
return m, nil
}
for _, s := range strings.Split(str, ",") {
switch minmax := strings.SplitN(s, "-", 2); len(minmax) {
case 2:
Expand Down

0 comments on commit e2b1f8c

Please sign in to comment.