]> err.no Git - sope/commitdiff
minor fixes
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Fri, 15 Oct 2004 10:50:54 +0000 (10:50 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Fri, 15 Oct 2004 10:50:54 +0000 (10:50 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@259 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-core/NGExtensions/ChangeLog
sope-core/NGExtensions/FdExt.subproj/NSString+Escaping.m
sope-core/NGExtensions/NGExtensions/NSString+Escaping.h
sope-core/NGExtensions/Version

index 751d7f5b8a58c391777a8b999b53d96896be2f60..23364de7d7bf6fae659d2c55085b30dc7a32b9bc 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-15  Helge Hess  <helge.hess@opengroupware.org>
+
+       * FdExt.subproj/NSString+Escaping.m: minor code cleanups, removed a
+         superflous if() condition (v4.3.124)
+
 2004-10-14  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * v4.3.123
index 0ef980c0404de9b6e54590046af6ede5c3c457af..a228be80c754a786de9ddcd6ed00bb2ef50dd6d4 100644 (file)
   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
   02111-1307, USA.
 */
-// $Id$
-
 
 #include <NGExtensions/NSString+Escaping.h>
 #include "common.h"
 
-@implementation NSString (Escaping)
+@implementation NSString(Escaping)
 
 - (NSString *)stringByApplyingCEscaping {
   // Unicode!
 {
   NSMutableString *safeString;
   unsigned length;
-  NSRange prevRange, escRange;
-  BOOL needsEscaping;
+  NSRange  prevRange, escRange;
+  NSRange  todoRange;
+  BOOL     needsEscaping;
   
   length    = [self length];
   prevRange = NSMakeRange(0, length);
   escRange  = [self rangeOfCharacterFromSet:_escSet options:0 range:prevRange];
 
   needsEscaping = escRange.length > 0 ? YES : NO;
-  if (!needsEscaping) {
+  if (!needsEscaping)
     return self; /* cheap */
-  }
   
   safeString = [NSMutableString stringWithCapacity:length];
-  if (needsEscaping) {
-    NSRange todoRange;
 
-    length = prevRange.length;
-    do {
-      NSString *s;
+  length = prevRange.length;
+  do {
+    NSString *s;
 
-      prevRange.length = escRange.location - prevRange.location;
-      if (prevRange.length > 0)
-        [safeString appendString:[self substringWithRange:prevRange]];
-      s = [_esc stringByEscapingString:[self substringWithRange:escRange]];
-      if (s)
+    prevRange.length = escRange.location - prevRange.location;
+    if (prevRange.length > 0)
+      [safeString appendString:[self substringWithRange:prevRange]];
+    
+    s = [_esc stringByEscapingString:[self substringWithRange:escRange]];
+    if (s != nil)
         [safeString appendString:s];
 
-      prevRange.location = NSMaxRange(escRange);
-      todoRange.location = prevRange.location;
-      todoRange.length   = length - prevRange.location;
-      escRange           = [self rangeOfCharacterFromSet:_escSet
-                                 options:0
-                                 range:todoRange];
-    }
-    while(escRange.length > 0);
-    if(todoRange.length > 0) {
-      [safeString appendString:[self substringWithRange:todoRange]];
-    }
+    prevRange.location = NSMaxRange(escRange);
+    todoRange.location = prevRange.location;
+    todoRange.length   = length - prevRange.location;
+    escRange           = [self rangeOfCharacterFromSet:_escSet
+                              options:0
+                              range:todoRange];
   }
+  while(escRange.length > 0);
+  
+  if (todoRange.length > 0)
+    [safeString appendString:[self substringWithRange:todoRange]];
+  
   return safeString;
 }
 
-@end
+@end /* NSString(Escaping) */
index d0a95c21d0a203849791abd3c5ebdc8b1954ae8b..19004943bbca4551bff2b8cfe49d9dec0616a877 100644 (file)
@@ -18,8 +18,6 @@
   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
   02111-1307, USA.
 */
-// $Id$
-
 
 #ifndef        __NGExtensions_NSString_Escaping_H__
 #define        __NGExtensions_NSString_Escaping_H__
@@ -35,7 +33,8 @@
 - (NSString *)stringByApplyingCEscaping;
 
 - (NSString *)stringByEscapingCharactersFromSet:(NSCharacterSet *)_set
-  usingStringEscaping:(<NGStringEscaping>)_esc;
+  usingStringEscaping:(id<NGStringEscaping>)_esc;
+
 @end
 
 #endif /* __NGExtensions_NSString_Escaping_H__ */
index 902b0e2d7f67402171064fd8f24774d4086259fe..bb8ba1953832529e8d401727f6fdf595fb0eb177 100644 (file)
@@ -1,6 +1,6 @@
 # version
 
-SUBMINOR_VERSION:=123
+SUBMINOR_VERSION:=124
 
 # v4.3.115 requires libFoundation v1.0.59
 # v4.2.72  requires libEOControl  v4.2.39