Skip to content

Commit c24ac41

Browse files
committed
Added ContainsValue method
1 parent 9a3d3c9 commit c24ac41

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: properties.go

+10
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,16 @@ func (m *Map) ContainsKey(key string) bool {
226226
return has
227227
}
228228

229+
// ContainsValue returns true if the map contains the specified value
230+
func (m *Map) ContainsValue(value string) bool {
231+
for _, v := range m.kv {
232+
if v == value {
233+
return true
234+
}
235+
}
236+
return false
237+
}
238+
229239
// Set inserts or replaces an existing key-value pair in the map
230240
func (m *Map) Set(key, value string) {
231241
if _, has := m.kv[key]; has {

0 commit comments

Comments
 (0)