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

Small code optimizations #2035

Merged
merged 8 commits into from
Aug 26, 2024
Merged

Small code optimizations #2035

merged 8 commits into from
Aug 26, 2024

Commits on Jul 16, 2024

  1. Add files via upload

    MoneyBund authored Jul 16, 2024
    Configuration menu
    Copy the full SHA
    106ecf2 View commit details
    Browse the repository at this point in the history
  2. Add files via upload

    MoneyBund authored Jul 16, 2024
    Configuration menu
    Copy the full SHA
    db0a83d View commit details
    Browse the repository at this point in the history
  3. Add files via upload

    MoneyBund authored Jul 16, 2024
    Configuration menu
    Copy the full SHA
    015bbd6 View commit details
    Browse the repository at this point in the history
  4. Small code optimizations

    MoneyBund authored Jul 16, 2024
    Configuration menu
    Copy the full SHA
    fc5ea12 View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2024

  1. Configuration menu
    Copy the full SHA
    c4fbf97 View commit details
    Browse the repository at this point in the history
  2. Small code optimizations

    HashSet Initialization:
    - Original code: let mut duplicate_checker = HashSet::new();
    - Optimized code: let mut duplicate_checker = HashSet::with_capacity(query_per_asset.len());
    The optimized code specifies the capacity when initializing the HashSet, avoiding potential multiple reallocations of memory during element insertion.
    
    Duplicate Check:
    - The optimized code uses the return value of HashSet::insert to check if the insertion was successful. If the insertion fails (i.e., the element already exists), it returns an error. This reduces one lookup operation.
    
    Using Option::map_or_else:
    - The optimized code simplifies the initialization logic of exclude by using the Option::map_or_else method.
    MoneyBund authored Jul 22, 2024
    Configuration menu
    Copy the full SHA
    061d1bf View commit details
    Browse the repository at this point in the history

Commits on Aug 20, 2024

  1. Configuration menu
    Copy the full SHA
    00f6abf View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2024

  1. Configuration menu
    Copy the full SHA
    7d91461 View commit details
    Browse the repository at this point in the history