Move.

帖子

分享您的知识。

YJS.
YJS94
Mar 19, 2025
专家问答

Comparing Vectors in Move with Mappings in Solidity

I’m trying to understand the differences between vectors in Move and mappings in Solidity. I’ve heard that they differ in terms of key types and iteration capabilities, but I’m not clear on the specifics. Can someone break down the main differences?

  • Move CLI
  • Move
0
1
分享
评论
.

答案

1
mssoni.
Mar 20 2025, 11:05

Table``vectorMove 与 Solidity 映射非常相似,而不是. 以下是一些关键区别: -vectorMove 中的 s 严格使用整数进行键控,而 Tables 可以使用任何类型作为密钥. -vectors 有大小限制,而 Tables 可以存储无限数量的元素. -对 vectors 进行迭代非常简单;但是,Tables 不支持类似于映射的直接迭代,尽管您可以将其LinkedTable用于迭代目的.

1
评论
.

你知道答案吗?

请登录并分享。

Move is an executable bytecode language used to implement custom transactions and smart contracts.

148帖子231答案
Sui.X.Peera.

赚取你的 1000 Sui 份额

获取声誉积分,并因帮助 Sui 社区成长而获得奖励。

奖励活动五月
我们使用 cookie 确保您在我们的网站上获得最佳体验。
更多信息