Browse Source

* string -> shortstring, check zero length instead of comparing to empty string

Michael VAN CANNEYT 2 years ago
parent
commit
01b70479a0
1 changed files with 7 additions and 7 deletions
  1. 7 7
      rtl/inc/isotmp.inc

+ 7 - 7
rtl/inc/isotmp.inc

@@ -24,7 +24,7 @@
         unique : Boolean;
       begin
         InternalChangeCase := S;
-        if InternalChangeCase = '' then
+        if Length(InternalChangeCase) then
           exit;
         unique := false;
         p := PWideChar(InternalChangeCase);
@@ -74,12 +74,12 @@
       FreeEnvironmentStringsW(p);
     end;
 
-    function getTempDir: String;
+    function getTempDir: ShortString;
     var
       astringLength : Integer;
     begin
       getTempDir := GetEnvironmentVariable('TMP');
-      if getTempDir = '' then
+      if Length(getTempDir)=0 then
         getTempDir := GetEnvironmentVariable('TEMP');
       astringlength := Length(getTempDir);
       if (astringlength > 0) and (getTempDir[astringlength] <> DirectorySeparator) then
@@ -90,10 +90,10 @@
 
 {$ELSEIF defined(UNIX) and not defined(android)}
 
-  function getTempDir: string;
+  function getTempDir: shortstring;
     var
-      key: string;
-      value: string;
+      key: shortstring;
+      value: shortstring;
       i_env, i_key, i_value: integer;
     begin
       value := '/tmp/';  (** default for UNIX **)
@@ -130,7 +130,7 @@
 
 {$ELSE}  // neither unix nor windows
 
-  function getTempDir: string;
+  function getTempDir: shortstring;
   begin
     getTempDir:='';
   end;