浏览代码

* Small optimization.

git-svn-id: trunk@5304 -
yury 19 年之前
父节点
当前提交
677defd615
共有 1 个文件被更改,包括 5 次插入6 次删除
  1. 5 6
      rtl/inc/elfres32.inc

+ 5 - 6
rtl/inc/elfres32.inc

@@ -119,13 +119,12 @@ begin
   { resources aren't case sensitive }
   n:=upcase(strpas(resourcename));
   searchhash:=HashELF(n);
-  I:=0;
-  While (Result=0) and (I<ResInfoCount) do
-    begin
+  for i:=0 to ResInfoCount-1 do
     if (FPCRuntimeResourceInfoArray[i].reshash=searchhash) and (upcase(FPCRuntimeResourceInfoArray[i].name)=n) then
-      result:=i+1;
-    Inc(I);
-    end;
+      begin
+        result:=i+1;
+        break;
+      end;
 end;
 
 function LoadResource(ModuleHandle: HMODULE; ResHandle: TResourceHandle): HGLOBAL;