Skip to content

Commit

Permalink
Fix repeated_keys
Browse files Browse the repository at this point in the history
  • Loading branch information
harupy committed Jan 22, 2023
1 parent b951169 commit 6ad0c41
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/rules/pyflakes/rules/repeated_keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ pub fn repeated_keys(checker: &mut Checker, keys: &[Option<Expr>], values: &[Exp
FxHashMap::with_capacity_and_hasher(keys.len(), BuildHasherDefault::default());

// Detect duplicate keys.
for (i, key) in keys.iter().flatten().enumerate() {
for (i, key) in keys.iter().enumerate() {
let Some(key) = key else {
continue;
};
if let Some(dict_key) = into_dictionary_key(key) {
if let Some(seen_values) = seen.get_mut(&dict_key) {
match dict_key {
Expand Down

0 comments on commit 6ad0c41

Please sign in to comment.