Eliminate closures creation in getvalue

This should be a small but significant optimization;  however getvalue'
still appears to be faster, at least for short strings.