Commit bd035335 authored by Kirill Smelkov's avatar Kirill Smelkov

X wcfs: SetObject unused

parent a8fa9178
// Code generated by gen-set Object interface{}; DO NOT EDIT.
// Copyright (C) 2015-2020 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
// This program is free software: you can Use, Study, Modify and Redistribute
// it under the terms of the GNU General Public License version 3, or (at your
// option) any later version, as published by the Free Software Foundation.
//
// You can also Link and Combine this program with other software covered by
// the terms of any of the Free Software licenses or any of the Open Source
// Initiative approved licenses and Convey the resulting work. Corresponding
// source of such a combination shall include the source code for all other
// software used.
//
// This program is distributed WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// See COPYING file for full licensing terms.
// See https://www.nexedi.com/licensing for rationale and options.
package main
// SetObject is a set of interface{}.
type SetObject map[interface{}]struct{}
// Add adds v to the set.
func (s SetObject) Add(v interface{}) {
s[v] = struct{}{}
}
// XXX + Del(v) ?
// Has checks whether the set contains v.
func (s SetObject) Has(v interface{}) bool {
_, ok := s[v]
return ok
}
// Update adds t values to s.
func (s SetObject) Update(t SetObject) {
for v := range t {
s.Add(v)
}
}
// Elements returns all elements of set as slice.
func (s SetObject) Elements() []interface{} {
ev := make([]interface{}, len(s))
i := 0
for e := range s {
ev[i] = e
i++
}
return ev
}
......@@ -22,7 +22,6 @@ package main
// TODO move -> btree when ΔTail matures.
//go:generate ./gen-set main Tree *Tree zset_tree.go
//go:generate ./gen-set main Object interface{} zset_object.go
import (
"context"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment