Skip to content

Commit 8f7d5e4

Browse files
author
Kaustubh Phatak
committed
Addressing review comment
1 parent fbfcf32 commit 8f7d5e4

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

internal/node/fs/util.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,14 @@ func supportsFS(instance *crusoeapi.InstanceV1Alpha5) bool {
4141
}
4242

4343
// All CPU instances support shared filesystems
44-
if typeSegments[0] == "c1a" || typeSegments[0] == "s1a" ||
45-
typeSegments[0] == "c2a" || typeSegments[0] == "s2a" {
44+
// Using map for O(1) lookup instead of slice with O(n) slices.Contains()
45+
supportedTypes := map[string]bool{
46+
"c1a": true,
47+
"s1a": true,
48+
"c2a": true,
49+
"s2a": true,
50+
}
51+
if supportedTypes[typeSegments[0]] {
4652
return true
4753
}
4854

0 commit comments

Comments
 (0)