[Code Issue] Unnecessary assignment?
Open
- Dominant language
- C++
- Stars
- 1.6k
- Forks
- 540
- PR merge metrics
- No merged PRs in 30d
Description
Looks like sometimes this assignment `env->kvs = envs;` in the body of `Environment::Init` method in env.h (https://github.com/dmlc/ps-lite/blob/db6189746c2acc5e6c3611df27f38b15029a7797/include/ps/internal/env.h#L36) is not necessary.
Assume we don't expect to re-assign new environment variables once we already assigned non-empty values, it might be better if we first check whether`Environment::kvs` is empty, if it's empty, we can do this assignment, otherwise, we won't.
If I'm on the track, would like to make a PR.
Thanks.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.