Skip to content

Commit

Permalink
Log duplicated top-level message only once (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-c authored Dec 19, 2019
1 parent c6fa9f3 commit 07e8f40
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ pub fn parse_lcov<T: Read>(
let mut cur_functions = FxHashMap::default();
// Only needed for the workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1597997.
let mut cur_fndas = HashSet::new();
let mut duplicated_error_logged = false;

let mut results = Vec::new();

Expand Down Expand Up @@ -193,8 +194,9 @@ pub fn parse_lcov<T: Read>(
let mut i = 1;

while cur_functions.contains_key(&f_name) {
if i == 1 {
error!("{} FN duplicated in a lcov file", f_name);
if i == 1 && !duplicated_error_logged {
error!("top-level FN duplicated in a lcov file");
duplicated_error_logged = true;
}

f_name = format!("top-level{}", i);
Expand Down

0 comments on commit 07e8f40

Please sign in to comment.