Modify the Server::getMessages() API #5

wants to merge 2 commits into

2 participants


Modified the Server::getMessages() API to make it always return an array, instead of returning false when there are no messages.

Tedious Developments member

Instead of removing those lines we should just return an empty array directly, rather than continuing those other calls against nothing.

I can do it. I just took the simpler option. It added close to no overhead, since it just got something already calculated, initializated an array, and then skipped the loop, but I'll change it to return an array.

@tedivm I had forgotten about this PR. I've updated the branch in order to make it mergeable.

@Lumbendil Lumbendil Update Server.php
Added a check to avoid un-necessary calls.
Tedious Developments member

I'm closing this out, as the functionality got pulled in through another PR. Thank you for the contribution though, it's always appreciated!

@tedivm tedivm closed this Mar 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment