diff options
author | anon5 <anon5clam@protonmail.com> | 2021-02-24 12:23:42 +0000 |
---|---|---|
committer | anon5 <anon5clam@protonmail.com> | 2021-02-24 12:23:42 +0000 |
commit | 27c0776cb2f1084356df5c9f6080fecf20f8fddf (patch) | |
tree | c0f9f3c3f660ca873d155b8b14bfef243c3485c5 /stack.go | |
parent | 4896d8f03c3f9bf8244f2f703a0ae28336c48a2a (diff) | |
download | mt-27c0776cb2f1084356df5c9f6080fecf20f8fddf.tar.xz |
Improve item meta handling
Diffstat (limited to 'stack.go')
-rw-r--r-- | stack.go | 35 |
1 files changed, 0 insertions, 35 deletions
@@ -22,41 +22,6 @@ type Item struct { ItemMeta } -type ItemMeta string - -func (m ItemMeta) Field(name string) (s string, ok bool) { - if len(m) > 0 && m[0] == 1 { - m = m[1:] - eat := func(stop byte) string { - for i := 0; i < len(m); i++ { - if m[i] == stop { - defer func() { - m = m[i+1:] - }() - return string(m[:i]) - } - } - defer func() { - m = "" - }() - return string(m) - } - for len(m) > 0 { - if eat(2) == name { - s = eat(3) - ok = true - } - } - return - } - - if name == "" { - return string(m), true - } - - return "", false -} - func (s Stack) String() string { if s.Count == 0 { return "" |