File: diff.php

package info (click to toggle)
monodevelop 5.10.0.871-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 272,040 kB
  • ctags: 258,152
  • sloc: cs: 1,439,098; xml: 947,206; ansic: 148,611; java: 64,114; makefile: 4,256; lisp: 3,174; python: 2,072; sh: 2,058; objc: 302; sql: 111; php: 65
file content (26 lines) | stat: -rw-r--r-- 950 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
diff --git a/files/file.php b/files/file.php
index 63250ad..967d646 100644
--- a/files/file.php
+++ b/files/file.php
@@ -12,2 +12,3 @@ class UniqueGenerator
     protected $maxRetries;
+	protected $moreStuff;
     protected $uniques = array();
@@ -17,3 +18,3 @@ class UniqueGenerator
         $this->generator = $generator;
-        $this->maxRetries = $maxRetries;
+        $this->maxRetries = $maxRetries + 1;
     }
@@ -33,10 +34,10 @@ class UniqueGenerator
     {
+        $i = 0;
         if (!isset($this->uniques[$name])) {
             $this->uniques[$name] = array();
         }
-        $i = 0;
         do {
             $res = call_user_func_array(array($this->generator, $name), $arguments);
             $i++;
-            if ($i > $this->maxRetries) {
+            if ($i >= $this->maxRetries) {
                 throw new \OverflowException(sprintf('Maximum retries of %d reached without finding a unique value', $this->maxRetries));