From bee40ea43c310d2545e06fc4b6473e7ea4cdbf33 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Mon, 9 Jan 2017 02:10:44 +0000 Subject: [PATCH] rebuild pages at da18e98 --- ch03-05-control-flow.html | 6 +++--- print.html | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ch03-05-control-flow.html b/ch03-05-control-flow.html index 6385b9d5c..4d07454c8 100644 --- a/ch03-05-control-flow.html +++ b/ch03-05-control-flow.html @@ -364,9 +364,9 @@ the value is: 50 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:

diff --git a/print.html b/print.html index 73a9ae4d6..85a36edaa 100644 --- a/print.html +++ b/print.html @@ -2352,9 +2352,9 @@ the value is: 50 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: