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

Enhancement/1610/method to force compact symbol list #1624

Merged

Conversation

alexowens90
Copy link
Collaborator

Reference Issues/PRs

Closes #1610

Considered augmenting list_symbols API to make this an option, but there are already a lot of arguments (particularly in the NativeVersionStore version) that this would not be compatible with, so added another method instead.

@@ -116,7 +116,7 @@ class StorageLock {
OnExit x{[that=this] () {
that->mutex_.unlock();
}};
if(!ref_key_exists(store) || ttl_expired(store)) {
if(!ref_key_exists(store) || !ttl_not_expired(store)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I find double negatives hard to read.

Copy link
Collaborator

@willdealtry willdealtry Jun 19, 2024

Choose a reason for hiding this comment

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

If I were refactoring I would probably replace both sides of the || with a single-line method whose name explains what is being checked if(no_lock_object_present() || lock_object_ttl_expired()

@@ -116,7 +116,7 @@ class StorageLock {
OnExit x{[that=this] () {
that->mutex_.unlock();
}};
if(!ref_key_exists(store) || ttl_expired(store)) {
if(!ref_key_exists(store) || !ttl_not_expired(store)) {
Copy link
Collaborator

@willdealtry willdealtry Jun 19, 2024

Choose a reason for hiding this comment

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

If I were refactoring I would probably replace both sides of the || with a single-line method whose name explains what is being checked if(no_lock_object_present() || lock_object_ttl_expired()

@alexowens90 alexowens90 force-pushed the enhancement/1610/method-to-force-compact-symbol-list branch from 24f9d79 to 10d9f07 Compare June 21, 2024 11:33
@alexowens90 alexowens90 merged commit 1cd7d33 into master Jun 21, 2024
114 checks passed
@alexowens90 alexowens90 deleted the enhancement/1610/method-to-force-compact-symbol-list branch June 21, 2024 14:42
@alexowens90 alexowens90 self-assigned this Jun 21, 2024
@alexowens90 alexowens90 added the enhancement New feature or request label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add method to forcibly compact the symbol list, and throw a useful error message if it fails
4 participants