lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [lucenenet] aaron-meyers commented on issue #226: Support.IO.FileSupport::fileCanonPathCache needs to be threadsafe
Date Fri, 07 Jun 2019 20:18:59 GMT
aaron-meyers commented on issue #226: Support.IO.FileSupport::fileCanonPathCache needs to be
threadsafe
URL: https://github.com/apache/lucenenet/pull/226#issuecomment-500025079
 
 
   Minor: it would be a little cleaner to change the type of the fileCanonPathCache field
to ConcurrentDictionary and use GetOrAdd rather than the indexer set when populating the fileCanonPathCache
in the GetCanonicalPath method (returning the result of GetOrAdd instead of the canonPath
value calculated in the method).
   
   I believe the GetCanonicalPath method should always produce the same value anyway but this
pattern ensures consistency in the event that a different value was produced for some reason.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message