Public feed #529020

Miscellany

public text v1 · immutable
Raw Edit
·published 2007-06-01 19:27 UTC
rendered paste body
// Set min to the smallest of tmp1, tmp2 and tmp3
// and set flags to indicate which ones were the 
// smallest. DELETE indicates tmp1, INSERT indicates tmp2,
// ALIGN indicates tmp3.

min = tmp1;
flags = DELETE;

if (tmp2 < min) {
        min = tmp2;
        flags = INSERT;
} else if (tmp2 == min) {
        flags |= INSERT;
}

if (tmp3 < min) {
        min = tmp3;
        flags = ALIGN;
} else if (tmp3 == min) {
        flags |= ALIGN;
}