optimize member assuming ranges remain ordered

Nice module and it inspired me to play around with it. Feel free to include these changes or not.