mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 16:47:28 +01:00
Add ByID and ByToken to token.IDMap.
This commit is contained in:
1 parent
f744089e9c
commit
cf8167a648
4 files changed
+20
-17
No files matched your search
@@ -57,6 +57,9 @@ func (m *IDMap) ByName(name string) ID {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *IDMap) ByID(x ID) string { return m.ByKey(Key(x >> KeyShift)) }
|
||||
func (m *IDMap) ByToken(t Token) string { return m.ByKey(Key(t.ID >> KeyShift)) }
|
||||
|
||||
func (m *IDMap) ByKey(k Key) string {
|
||||
if k < nBuiltInKeys {
|
||||
return builtInsByKey[k].name
|
||||
|
||||
Reference in new issue
Block a user