Changes in uspace/dist/src/sysel/lib/map.sy [c5cb943d:051bc69a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/dist/src/sysel/lib/map.sy
rc5cb943d r051bc69a 91 91 end 92 92 end 93 94 fun GetEnumerator() : IEnumerator/tkey is95 return new MapEnumerator/tkey/tvalue(data.get_first());96 end97 93 end 98 94 … … 101 97 var Value : tvalue; 102 98 end 103 104 class MapEnumerator/tkey/tvalue : IEnumerator/tkey is105 var first : ListNode/(MapPair/tkey/tvalue);106 var current : ListNode/(MapPair/tkey/tvalue);107 var started : bool;108 109 new(first_node : ListNode/(MapPair/tkey/tvalue)) is110 first = first_node;111 current = nil;112 started = false;113 end114 115 fun MoveNext() : bool is116 if started then117 current = current.Next;118 else119 current = first;120 started = true;121 end122 123 return current != nil;124 end125 126 prop Data : tkey is127 get is128 return current.Data.Key;129 end130 end131 end
Note:
See TracChangeset
for help on using the changeset viewer.