[Libreoffice-commits] core.git: opencl/source

Tomaž Vajngerl tomaz.vajngerl at collabora.com
Tue Oct 18 22:13:46 UTC 2016


 opencl/source/openclwrapper.cxx |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

New commits:
commit baeb3b43fb67192e8e8639e2d5dd21ccbf5178a4
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Tue Oct 11 13:01:01 2016 +0200

    opencl: convert to C++11 for loop
    
    Change-Id: Id96a3816eb7ef2241f5a6a57b164e1e366eb357a
    Reviewed-on: https://gerrit.libreoffice.org/29693
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index 3daa019..c876133 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -739,16 +739,14 @@ namespace {
 
 cl_device_id findDeviceIdByDeviceString(const OUString& rString, const std::vector<OpenCLPlatformInfo>& rPlatforms)
 {
-    std::vector<OpenCLPlatformInfo>::const_iterator it = rPlatforms.begin(), itEnd = rPlatforms.end();
-    for(; it != itEnd; ++it)
+    for (const OpenCLPlatformInfo& rPlatform : rPlatforms)
     {
-        std::vector<OpenCLDeviceInfo>::const_iterator itr = it->maDevices.begin(), itrEnd = it->maDevices.end();
-        for(; itr != itrEnd; ++itr)
+        for (const OpenCLDeviceInfo& rDeviceInfo : rPlatform.maDevices)
         {
-            OUString aDeviceId = it->maVendor + " " + itr->maName;
-            if(rString == aDeviceId)
+            OUString aDeviceId = rDeviceInfo.maVendor + " " + rDeviceInfo.maName;
+            if (rString == aDeviceId)
             {
-                return static_cast<cl_device_id>(itr->device);
+                return rDeviceInfo.device;
             }
         }
     }


More information about the Libreoffice-commits mailing list