unspent: new implementation may be faster in common cases.