Compare commits

...
4 Commits
Author SHA1 Message Date
Kevin Darby da42e95754 fixed externals and docker 2019-09-25 10:59:58 -04:00
Kevin Darby a878a55ac1 moved externals 2019-09-25 10:00:20 -04:00
John Colvin 4305d560aa Merged in pnl-rounding-error (pull request #359)
RTM Pnl rounding error

Approved-by: Jake Norbut <jake.norbut@bluetradesys.com>
Approved-by: Eric Harding <eric.harding@bluetradesys.com>
2019-09-25 13:57:52 +00:00
John Colvin 055f0015e7 Update.naggle pr edit: 'TryPop' is an innappropriate name (just use 'Remove') 2019-09-24 17:28:06 -05:00
3 changed files with 6 additions and 6 deletions

No files matched your search

+4 -4
View File
@@ -100,7 +100,7 @@ namespace bts.api.core {
// Add
foreach (var v in next.added) {
var k = _key(v);
if (removed.TryPop(k, out var oldval)) {
if (removed.Remove(k, out var oldval)) {
changes.AddOrMerge(new Change<T>(oldval, v));
} else {
added[k] = v;
@@ -110,7 +110,7 @@ namespace bts.api.core {
// Change
foreach (var c in next.changes) {
var k = _key(c.Old);
if (!added.TryReplace(k, c.New))
if (!added.Replace(k, c.New))
changes.AddOrMerge(c);
}
@@ -162,10 +162,10 @@ namespace bts.api.core {
public bool Remove(TKey key) =>
_cache.Remove(key);
public bool TryPop(TKey key, out TValue value) =>
public bool Remove(TKey key, out TValue value) =>
_cache.TryGetValue(key, out value) && _cache.Remove(key);
public bool TryReplace(TKey key, TValue value) {
public bool Replace(TKey key, TValue value) {
if (_cache.ContainsKey(key)) {
_cache[key] = value;
return true;