Преглед изворни кода

Call starpu_get_memory_nodes_count() only once instead of every time through the loop.

Cyril Roelandt пре 13 година
родитељ
комит
cbe6828ab9
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      src/datawizard/write_back.c

+ 2 - 2
src/datawizard/write_back.c

@@ -38,8 +38,8 @@ void _starpu_write_through_data(starpu_data_handle_t handle, uint32_t requesting
 	}
 
 	/* first commit all changes onto the nodes specified by the mask */
-	uint32_t node;
-	for (node = 0; node < starpu_get_memory_nodes_count(); node++)
+	uint32_t node, max;
+	for (node = 0, max = starpu_get_memory_nodes_count(); node < max; node++)
 	{
 		if (write_through_mask & (1<<node))
 		{