Skip to content

Commit 0381450

Browse files
author
Noam Preil
committed
faster Map test
1 parent faedd54 commit 0381450

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

arrow/schema.go

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package arrow
1818

1919
import (
2020
"fmt"
21+
"maps"
2122
"slices"
2223
"strings"
2324

@@ -136,20 +137,7 @@ func (md Metadata) sortedIndices() []int {
136137
}
137138

138139
func (md Metadata) Equal(rhs Metadata) bool {
139-
if md.Len() != rhs.Len() {
140-
return false
141-
}
142-
143-
idxes := md.sortedIndices()
144-
rhsIdxes := rhs.sortedIndices()
145-
for i := range idxes {
146-
j := idxes[i]
147-
k := rhsIdxes[i]
148-
if md.keys[j] != rhs.keys[k] || md.values[j] != rhs.values[k] {
149-
return false
150-
}
151-
}
152-
return true
140+
return maps.Equal(md.ToMap(), rhs.ToMap())
153141
}
154142

155143
// Schema is a sequence of Field values, describing the columns of a table or

0 commit comments

Comments
 (0)