Cache the Path() call, as it's quite expensive and called a lot

This commit is contained in:
Jakob Borg
2015-11-05 08:31:36 +00:00
parent 36f6a9347c
commit 34aa41e17b
3 changed files with 43 additions and 23 deletions

View File

@@ -175,7 +175,7 @@ func (cfg *Configuration) prepare(myID protocol.DeviceID) {
cfg.Options.ListenAddress = uniqueStrings(cfg.Options.ListenAddress)
cfg.Options.GlobalAnnServers = uniqueStrings(cfg.Options.GlobalAnnServers)
if cfg.Version < OldestHandledVersion {
if cfg.Version > 0 && cfg.Version < OldestHandledVersion {
l.Warnf("Configuration version %d is deprecated. Attempting best effort conversion, but please verify manually.", cfg.Version)
}