Skip to content

read_csv_id_file: Remove unnecessary contains_key#480

Merged
tsmbland merged 2 commits intomainfrom
remove-unnecessary-contains-key
Apr 14, 2025
Merged

read_csv_id_file: Remove unnecessary contains_key#480
tsmbland merged 2 commits intomainfrom
remove-unnecessary-contains-key

Conversation

@alexdewar
Copy link
Copy Markdown
Member

I noticed this while reviewing your PR. It's not actually that big of a deal, but I felt the itch to fix it anyway.

@alexdewar alexdewar requested review from Copilot and tsmbland April 14, 2025 15:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refines the duplicate check when reading CSV records by removing an explicit contains_key check and instead relying on the return value of the insert operation.

  • Simplifies duplicate key detection by using map.insert return value
  • Removes redundant contains_key check
Comments suppressed due to low confidence (1)

src/input.rs:156

  • [nitpick] The variable name 'existing' may be ambiguous regarding its purpose; consider renaming it to something more descriptive such as 'duplicateFound' to enhance clarity.
let existing = map.insert(Rc::clone(&id), record).is_some();

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.13%. Comparing base (441197f) to head (cfb422c).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/input.rs 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #480      +/-   ##
==========================================
- Coverage   95.13%   95.13%   -0.01%     
==========================================
  Files          36       36              
  Lines        4931     4930       -1     
  Branches     4931     4930       -1     
==========================================
- Hits         4691     4690       -1     
  Misses        120      120              
  Partials      120      120              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tsmbland tsmbland enabled auto-merge April 14, 2025 15:08
@tsmbland tsmbland merged commit 0cdcf2e into main Apr 14, 2025
7 checks passed
@tsmbland tsmbland deleted the remove-unnecessary-contains-key branch April 14, 2025 15:12
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.

3 participants