From 784a3ec5e8b9c6bff456ab9f0efd4dabcc180dda Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sun, 8 Jan 2017 21:56:12 -0300 Subject: [PATCH] The compiler doesn't execute at runtime --- src/ch03-05-control-flow.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ch03-05-control-flow.md b/src/ch03-05-control-flow.md index f2e1d3584..c9ec026c0 100644 --- a/src/ch03-05-control-flow.md +++ b/src/ch03-05-control-flow.md @@ -387,9 +387,9 @@ will reach a value of `5` at some point, the loop stops executing before trying to fetch a sixth value from the array. But this approach is error prone; we could cause the program to panic if the -index length is incorrect. It’s also slow, because the compiler needs to -perform the conditional check on every element on every iteration through the -loop. +index length is incorrect. It’s also slow, because the compiler adds +runtime code to perform the conditional check on every element on every +iteration through the loop. As a more efficient alternative, you can use a `for` loop and execute some code for each item in a collection. A `for` loop looks like this: