google / google/rrg

Avoid repeated reads in `get_file_metadata`

Open
#209 0 comments 0 reactions 1 assignee Claimed by @panhania View on GitHub
Dominant language
Rust
Stars
70
Forks
34
Avg merge
1d 23h
Merged PRs (30d)
25

Description

Currently `get_file_metadata` can open and read contents of the entire file twice: one for doing regex matching and one for calculating the digest. Given that I/O is probably the slowest part of the code, we should avoid it whenever possible and so the code should be refactored to open and read the file only once.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.