How do I retrieve the first key from Gee.SortedMap in Vala? For example if I have
Gee.SortedMap<int, string> foo = new Gee.TreeMap<int, string> ();
I want to get the first key, i.e. the lowest int in foo. In Java we have java.util.SortedMap.firstKey(). I cannot find an equivalent in Vala.
The
SortedMap
has anascending_keys
property that returns aSortedSet
. Then you can get thefirst()
item from theSortedSet
: