sbobek / DynamicAdvertising

0 stars 0 forks source link

DEIncomingConnectionHandler - wyliczanie secondBest #6

Closed danius0001 closed 6 years ago

danius0001 commented 6 years ago

if (bid > bestPrice) { secondBest = bestPrice; bestPrice = bid; bestSocket = socket; } if (bid < bestPrice && bid > secondBest) { secondBest = bid; }

Gdy bid == aktualny bestPrice -> secondBest nie będzie poprawnie wyliczony. Tak będzie ok: if (bid > bestPrice) { secondBest = bestPrice; bestPrice = bid; bestSocket = socket; } else if (bid > secondBest) { secondBest = bid; }

HrabiaVulpes commented 6 years ago

Rozumiem, poprawka wprowadzona.