Fastest way to get all values from a Map where the key starts with a certain expression

前端 未结 5 1997
不思量自难忘°
不思量自难忘° 2020-12-15 05:58

Consider you have a map myMap.

Given the expression \"some.string.*\", I have to retrieve all the values from m

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-15 06:37

    map's keyset has no a special structure so I think you have to check each of the keys anyway. So you can't find a way which will be faster than a single loop...

提交回复
热议问题