From: Francisco Jerez Date: Tue, 14 Jan 2014 20:47:46 +0000 (+0100) Subject: clover: Store map result into a temporary vector in clCreateProgramWithBinary. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=efcc84f425f26905e0c6627993108e5927bd81b3;p=mesa.git clover: Store map result into a temporary vector in clCreateProgramWithBinary. This avoids the inefficient multiple evaluation of the map result in the code below. It should cause no functional changes. Tested-by: "Dorrington, Albert" --- diff --git a/src/gallium/state_trackers/clover/api/program.cpp b/src/gallium/state_trackers/clover/api/program.cpp index 7d060c44aa1..6049209b6a0 100644 --- a/src/gallium/state_trackers/clover/api/program.cpp +++ b/src/gallium/state_trackers/clover/api/program.cpp @@ -69,7 +69,7 @@ clCreateProgramWithBinary(cl_context d_ctx, cl_uint n, throw error(CL_INVALID_DEVICE); // Deserialize the provided binaries, - auto result = map( + std::vector> result = map( [](const unsigned char *p, size_t l) -> std::pair { if (!p || !l) return { CL_INVALID_VALUE, {} };