lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [lucenenet] sthmathew commented on issue #226: Support.IO.FileSupport::fileCanonPathCache needs to be threadsafe
Date Fri, 07 Jun 2019 20:40:05 GMT
sthmathew commented on issue #226: Support.IO.FileSupport::fileCanonPathCache needs to be threadsafe
URL: https://github.com/apache/lucenenet/pull/226#issuecomment-500031160
 
 
   > 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.
   
   Yeah, I originally didn't want to change too much, so I made the smallest possible change.
Updated to use GetOrAdd with the valuefactory now.

----------------------------------------------------------------
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