Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary drops from storage impls. #5952

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

gilbens-starkware
Copy link
Contributor

@gilbens-starkware gilbens-starkware commented Jul 3, 2024

This change is Reviewable

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewed 11 of 11 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @gilbens-starkware)


corelib/src/starknet/storage.cairo line 266 at r1 (raw file):

    +core::hash::Hash<EntryInfo::<T>::Key, StoragePathHashState>,
    +starknet::Store<EntryInfo::<T>::Value>,
    +Drop<EntryInfo::<T>::Key>,

this doesn't seem required as well.

Code quote:

    +Drop<EntryInfo::<T>::Key>,

corelib/src/starknet/storage.cairo line 298 at r1 (raw file):

    +core::hash::Hash<EntryInfo::<MutableTrait::<T>::InnerType>::Key, StoragePathHashState>,
    +starknet::Store<EntryInfo::<MutableTrait::<T>::InnerType>::Value>,
    +Drop<EntryInfo::<MutableTrait::<T>::InnerType>::Key>,

ditto

Code quote:

    +Drop<EntryInfo::<MutableTrait::<T>::InnerType>::Key>,

corelib/src/starknet/storage.cairo line 512 at r1 (raw file):

    impl PointerImpl: StorageAsPointer<T>,
    impl AccessImpl: StoragePointerReadAccess<StoragePointer0Offset<PointerImpl::Value>>,
    +Drop<T>,

ditto

Code quote:

    +Drop<T>,

Copy link
Contributor Author

@gilbens-starkware gilbens-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @orizi)


corelib/src/starknet/storage.cairo line 266 at r1 (raw file):

Previously, orizi wrote…

this doesn't seem required as well.

It is, the arg key is dropped in case of a panic.

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @gilbens-starkware)


corelib/src/starknet/storage.cairo line 266 at r1 (raw file):

Previously, gilbens-starkware (Gil Ben-Shachar) wrote…

It is, the arg key is dropped in case of a panic.

the key is used in the first .entry(key) call.

Copy link
Contributor Author

@gilbens-starkware gilbens-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 11 files reviewed, 3 unresolved discussions (waiting on @orizi)


corelib/src/starknet/storage.cairo line 266 at r1 (raw file):

Previously, orizi wrote…

the key is used in the first .entry(key) call.

You are of course correct. Done


corelib/src/starknet/storage.cairo line 298 at r1 (raw file):

Previously, orizi wrote…

ditto

Done.


corelib/src/starknet/storage.cairo line 512 at r1 (raw file):

Previously, orizi wrote…

ditto

Done.

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 11 files at r2, all commit messages.
Reviewable status: 2 of 11 files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware)


corelib/src/starknet/storage.cairo line 512 at r1 (raw file):

Previously, gilbens-starkware (Gil Ben-Shachar) wrote…

Done.

still here.

Copy link
Contributor Author

@gilbens-starkware gilbens-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 11 files reviewed, 1 unresolved discussion (waiting on @orizi)


corelib/src/starknet/storage.cairo line 512 at r1 (raw file):

Previously, orizi wrote…

still here.

Done.

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 11 of 11 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @gilbens-starkware)

@gilbens-starkware gilbens-starkware added this pull request to the merge queue Jul 4, 2024
Merged via the queue into main with commit 92935a1 Jul 4, 2024
87 checks passed
@orizi orizi deleted the spr/main/39205511 branch July 7, 2024 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants