exchange/src/main/java/ExchangeMarket.java
private Order findOrder(Side side, long sourceAddress, long orderTime) {
        TreeSet<Order> market = getMarket(side);
        Iterator<Order> it = market.iterator();
        while (it.hasNext()) {
            Order order = it.next();
            if (order.matches(sourceAddress, orderTime)) {
                it.remove();
                expirationOrder.remove(order);
                return order;
            }
        }
        return null;
    }
/**
     * VERY VERY inefficient, but good for testing
     */
VERY VERY inefficient, but good for testing
VERY VERY inefficient but good for testing
private Order findOrder(Side side, long sourceAddress, long orderTime) {
        TreeSet<Order> market = getMarket(side);
        Iterator<Order> it = market.iterator();
        while (it.hasNext()) {
            Order order = it.next();
            if (order.matches(sourceAddress, orderTime)) {
                it.remove();
                expirationOrder.remove(order);
                return order;
            }
        }
        return null;
    }
private Order findOrder ( Side side , long sourceAddress , long orderTime ) { TreeSet < Order > market = getMarket ( side ) ; Iterator < Order > it = market . iterator ( ) ; while ( it . hasNext ( ) ) { Order order = it . next ( ) ; if ( order . matches ( sourceAddress , orderTime ) ) { it . remove ( ) ; expirationOrder . remove ( order ) ; return order ; } } return null ; }
VERY VERY inefficient, but good for testing
VERY VERY inefficient but good for testing