Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Simplified looping code.

  • Loading branch information...
commit 8910199d3c7cbaef93ceefa2137de247ac44c83a 1 parent 21b4204
@derickr authored
Showing with 9 additions and 14 deletions.
  1. +9 −14 mongo.c
View
23 mongo.c
@@ -471,20 +471,15 @@ PHP_METHOD(Mongo, close)
if (Z_BVAL_P(hash)) {
/* Close all connections */
mongo_con_manager_item *ptr = link->manager->connections;
- mongo_con_manager_item *current = ptr;
- long count = 0;
-
- do {
- if (current) {
- ptr = current;
- current = current->next;
- close_connection(link->manager, ptr->connection);
- count++;
- }
- else {
- break;
- }
- } while(1);
+ mongo_con_manager_item *current;
+ long count = 0;
+
+ while (ptr) {
+ current = ptr;
+ ptr = ptr->next;
+ close_connection(link->manager, current->connection);
+ count++;
+ }
RETVAL_LONG(count);
} else {

0 comments on commit 8910199

Please sign in to comment.
Something went wrong with that request. Please try again.