summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2020-09-19 00:36:03 -0400
committerrsiddharth <s@ricketyspace.net>2020-09-19 00:36:03 -0400
commitaf0654c8cbbd25a56f4a5ae6fed8ddb275413ec7 (patch)
treecbfdb4958242ab5c57d260ca076355a796d1b7d9
parentd5d8dd74c8f509f45b015435f21d7ea2173ec457 (diff)
cedar.go: add Ids.add
-rw-r--r--cedar.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/cedar.go b/cedar.go
index 49b1330..2dfc058 100644
--- a/cedar.go
+++ b/cedar.go
@@ -107,4 +107,17 @@ func cacheFor(section string) (Ids, error) {
return cache, nil
}
+func (cache *Ids) add(entry Entry) {
+ n := len(*cache)
+
+ // Expand cache
+ c := make(Ids, n+1)
+ copy(c, *cache)
+
+ // Cache entry
+ c[n] = entry.Id
+
+ *cache = c
+}
+
func main() {}