Skip to content

Commit 73def37

Browse files
committed
Fix broken "compute language availability" algorithm
The intention is to get the minimum availability over all languages, so we return "unavailable" the first time we encounter an unavailable language. Closes #58.
1 parent 27bf346 commit 73def37

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

index.bs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2330,6 +2330,8 @@ A <dfn>language availabilities triple</dfn> is a [=struct=] with the following [
23302330

23312331
1. [=set/For each=] |language| of |requestedLanguages|:
23322332

2333+
1. Let |unavailable| be true.
2334+
23332335
1. [=list/For each=] |availabilityToCheck| of « "{{Availability/available}}", "{{Availability/downloading}}", "{{Availability/downloadable}}" »:
23342336

23352337
1. Let |languagesWithThisAvailability| be |partition|[|availabilityToCheck|].
@@ -2342,9 +2344,11 @@ A <dfn>language availabilities triple</dfn> is a [=struct=] with the following [
23422344

23432345
1. Set |availability| to the [=Availability/minimum availability=] given |availability| and |availabilityToCheck|.
23442346

2347+
1. Set |unavailable| to false.
2348+
23452349
1. [=iteration/Break=].
23462350

2347-
1. Return "{{Availability/unavailable}}".
2351+
1. If |unavailable| is true, then return "{{Availability/unavailable}}".
23482352

23492353
1. Return |availability|.
23502354
</div>

0 commit comments

Comments
 (0)