我有一些这样的代码:
Table = ets:new(table, [bag]),
true = ets:insert(Table, {bucket_1, some_value_1}),
true = ets:insert(Table, {bucket_1, some_value_2}),
true = ets:insert(Table, {bucket_1, some_value_3}),
LookupResult = ets:lookup(Table, bucket_1),
?_assertEqual(
[{bucket_1, some_value_1}, {bucket_1, some_value_2}, {bucket_1, some_value_3}],
LookupResult
).
ETS 是否保证桶内元素的排序?我是否应该期望 ETS 保存元素的顺序,因为元素已添加到表中?