Author: rfm
Date: Wed May 27 08:02:43 2015
New Revision: 38575

URL: http://svn.gna.org/viewcvs/gnustep?rev=38575&view=rev
Log:
fix logic of -longestIdle

Modified:
    libs/sqlclient/trunk/SQLClient.m

Modified: libs/sqlclient/trunk/SQLClient.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/sqlclient/trunk/SQLClient.m?rev=38575&r1=38574&r2=38575&view=diff
==============================================================================
--- libs/sqlclient/trunk/SQLClient.m    (original)
+++ libs/sqlclient/trunk/SQLClient.m    Wed May 27 08:02:43 2015
@@ -1417,8 +1417,6 @@
   NSTimeInterval        t0;
   NSTimeInterval        t1;
 
-  NSAssert([other isKindOfClass: SQLClientClass], NSInvalidArgumentException);
-
   t0 = _lastOperation;
   if (t0 < _lastStart)
     {
@@ -1429,7 +1427,7 @@
       t0 = 0.0;
     }
 
-  if (YES == [other isProxy])
+  if (NO == [other isKindOfClass: SQLClientClass] || YES == [other isProxy])
     {
       t1 = 0.0;
     }
@@ -1440,21 +1438,21 @@
         {
           t1 = other->_lastStart;
         }
-      if (NO == connected || 0 != other->_connectFails)
+      if (NO == other->connected || 0 != other->_connectFails)
         {
           t1 = 0.0;
         }
     }
 
-  if (t0 <= 0.0 && t1 <= 0.0)
-    {
-      return nil;
-    }
-  if (t1 <= t0)
+  if (t1 > 0.0 && t1 <= t0)
     {
       return other;
     }
-  return self;
+  if (t0 > 0.0 && t0 <= t1)
+    {
+      return self;
+    }
+  return nil;
 }
 
 - (NSString*) name


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to