-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add string interning to assets and symbols
For #84. Update static assets and symbols.
- Loading branch information
Showing
6 changed files
with
447 additions
and
447 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,10 +124,10 @@ static Symbol() | |
// <<insert symbol definitions>> | ||
|
||
// Redirect (BCH) Bitcoin Cash (BCC = BitConnect) | ||
{ "BCHUSDT", BCC_USDT }, | ||
{ "BCHBNB", BCC_BNB }, | ||
{ "BCHBTC", BCC_BTC }, | ||
{ "BCHETH", BCC_ETH } | ||
{ string.Intern("BCHUSDT"), BCC_USDT }, | ||
This comment has been minimized.
Sorry, something went wrong.
sguryev
|
||
{ string.Intern("BCHBNB"), BCC_BNB }, | ||
{ string.Intern("BCHBTC"), BCC_BTC }, | ||
{ string.Intern("BCHETH"), BCC_ETH } | ||
}; | ||
} | ||
catch (Exception e) | ||
|
@@ -167,7 +167,7 @@ public Symbol(SymbolStatus status, Asset baseAsset, Asset quoteAsset, InclusiveR | |
IsIcebergAllowed = isIcebergAllowed; | ||
OrderTypes = orderTypes; | ||
|
||
_symbol = $"{baseAsset}{quoteAsset}"; | ||
_symbol = string.Intern($"{baseAsset}{quoteAsset}"); | ||
} | ||
|
||
#endregion Constructors | ||
|
@@ -237,7 +237,7 @@ public static void UpdateCache(IEnumerable<Symbol> symbols) | |
// ReSharper disable once PossibleMultipleEnumeration | ||
foreach (var symbol in symbols) | ||
{ | ||
Cache[symbol] = symbol; | ||
Cache[string.Intern(symbol)] = symbol; | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
All literals are interned automatically: https://stackoverflow.com/a/8692317/1521008