Skip to content
This repository was archived by the owner on Aug 24, 2024. It is now read-only.

Hshq patch 3 #31

Merged
merged 3 commits into from
Jan 19, 2024
Merged

Hshq patch 3 #31

merged 3 commits into from
Jan 19, 2024

Conversation

hshq
Copy link
Contributor

@hshq hshq commented Jan 17, 2024

fix .typo


如果把所有东西都放在一个函数中,再加上一个像 `User` 这样的小值,这仍然像是一个人为制造的问题。我们需要一个能让数据所有权成为当务之急的例子。

## 所有权 Ownership

我喜欢哈希表(HashMap),因为这是每个人都知道并且会经常使用的结构。它们有很多不同的用例,其中大部分你可能都用过。虽然哈希表可以用在一个局部查找的地方,但通常是从程序的整个运行期常驻的,因此插入其内的值需要同样长的生命周期。
我喜欢哈希表(HashMap),因为这是每个人都知道并且会经常使用的结构。它们有很多不同的用例,其中大部分你可能都用过。虽然哈希表可以用在一个短期查找的地方,但通常是从程序的整个运行期常驻的,因此插入其内的值需要同样长的生命周期。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

『短期查找』没听过这个说法

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里谈的是生命周期,因此,“局部”作为作用域里的概念,不如“短期”合适,
而且,英文里是“short lived”,跟“long-lived”对应。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,我又简单瑞色了下,

@jiacai2050 jiacai2050 merged commit da64eae into zigcc:main Jan 19, 2024
1 check passed
@hshq hshq deleted the hshq-patch-3 branch January 19, 2024 13:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants