lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [lucenenet] aaron-meyers commented on issue #224:
Date Mon, 04 Mar 2019 15:02:05 GMT
aaron-meyers commented on issue #224:
   This is great, we've run into this issue in production with Lucene.Net but hadn't been
able to isolate a repro.
   One minor comment: when possible, avoid using static constructors and instead initialize
static fields directly (using private static helper methods if needed).
   e.g. instead of
           public static readonly int GOOD_FAST_HASH_SEED;
           static StringHelper()
               GOOD_FAST_HASH_SEED = x;
   use this pattern:
           public static readonly int GOOD_FAST_HASH_SEED = InitializeHashSeed();
           private static int InitializeHashSeed()
               return x;
   It may look like these are equivalent but in fact they are not. Using the latter pattern
gives the CLR more flexibility in how it initializes the class.
   More details:

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:

With regards,
Apache Git Services

View raw message