I think you could also replace this while-loop with a 

`result.keys.slice(0, limit);`