Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed unnecessary ofstream #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cgr71ii
Copy link

@cgr71ii cgr71ii commented Jan 13, 2021

The removed line seems to not be necessary. I have been testing removing it and everything went good, even modifying the bool logging to true in

bool logging = false;

Until now, Bitextor have been using Hunalign for years from an own repository which contained the Hunalign release 1.2, but now that there is an official repo, we would like to use it directly instead. The problem is that the generated file translated.txt is always generated, even when logging = false, which is the default value. This file is not necessary when the logging is disabled, and it is not necessary since when the file is opened because logging = true, it is generated if does not exist (std::ios::app creates the file if does not exist). Doing this, we avoid to generate this file if it is not necessary, since if any other file with the same name exists, it will rewrite its content as I have tested that happens (the reason is that the default opening mode for ofstream is std::ios::out).

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.

2 participants