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.
Currently
get_file_metadatacan 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.