Skip to content

Commit

Permalink
replace non-breaking spaces with plain spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski committed Feb 17, 2022
1 parent 0d3acba commit 1e207c2
Show file tree
Hide file tree
Showing 24 changed files with 80 additions and 80 deletions.
2 changes: 1 addition & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4099,7 +4099,7 @@ Library improvements
+ Using colons (`:`) to represent a collection of indices is deprecated. They now must be
explicitly converted to a specialized array of integers with the `to_indices` function.
   As a result, the type of `SubArray`s that represent views over colon indices has changed.
As a result, the type of `SubArray`s that represent views over colon indices has changed.
+ Logical indexing is now more efficient. Logical arrays are converted by `to_indices` to
a lazy, iterable collection of indices that doesn't support indexing. A deprecation
Expand Down
2 changes: 1 addition & 1 deletion base/abstractset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ issetequal(a::AbstractSet, b) = issetequal(a, Set(b))
function issetequal(a, b::AbstractSet)
if haslength(a)
# check b for too many unique elements
length(a) < length(b) && return false
length(a) < length(b) && return false
end
return issetequal(Set(a), b)
end
Expand Down
2 changes: 1 addition & 1 deletion base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ the `value` that was passed; this means that if the `value` is itself modified,
all elements of the `fill`ed array will reflect that modification because they're
_still_ that very `value`. This is of no concern with `fill(1.0, (5,5))` as the
`value` `1.0` is immutable and cannot itself be modified, but can be unexpected
with mutable values like — most commonly — arrays. For example, `fill([], 3)`
with mutable values like — most commonly — arrays. For example, `fill([], 3)`
places _the very same_ empty array in all three locations of the returned vector:
```jldoctest
Expand Down
2 changes: 1 addition & 1 deletion base/gmp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ function digits!(a::AbstractVector{T}, n::BigInt; base::Integer = 10) where {T<:
i, j = firstindex(a)-1, length(s)+1
lasti = min(lastindex(a), firstindex(a) + length(s)-1 - isneg(n))
while i < lasti
# base ≤ 36: 0-9, plus a-z for 10-35
# base ≤ 36: 0-9, plus a-z for 10-35
# base > 36: 0-9, plus A-Z for 10-35 and a-z for 36..61
x = s[j -= 1]
a[i += 1] = base 36 ? (x>0x39 ? x-0x57 : x-0x30) : (x>0x39 ? (x>0x60 ? x-0x3d : x-0x37) : x-0x30)
Expand Down
8 changes: 4 additions & 4 deletions base/indices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ A linear indexing style uses one integer index to describe the position in the a
(even if it's a multidimensional array) and column-major
ordering is used to efficiently access the elements. This means that
requesting [`eachindex`](@ref) from an array that is `IndexLinear` will return
a simple one-dimensional range, even if it is multidimensional.
a simple one-dimensional range, even if it is multidimensional.
A custom array that reports its `IndexStyle` as `IndexLinear` only needs
to implement indexing (and indexed assignment) with a single `Int` index;
all other indexing expressions — including multidimensional accesses — will
all other indexing expressions — including multidimensional accesses — will
be recomputed to the linear index. For example, if `A` were a `2×3` custom
matrix with linear indexing, and we referenced `A[1, 3]`, this would be
recomputed to the equivalent linear index and call `A[5]` since `2*1 + 3 = 5`.
Expand All @@ -50,13 +50,13 @@ a range of [`CartesianIndices`](@ref).
A `N`-dimensional custom array that reports its `IndexStyle` as `IndexCartesian` needs
to implement indexing (and indexed assignment) with exactly `N` `Int` indices;
all other indexing expressions — including linear indexing — will
all other indexing expressions — including linear indexing — will
be recomputed to the equivalent Cartesian location. For example, if `A` were a `2×3` custom
matrix with cartesian indexing, and we referenced `A[5]`, this would be
recomputed to the equivalent Cartesian index and call `A[1, 3]` since `5 = 2*1 + 3`.
It is significantly more expensive to compute Cartesian indices from a linear index than it is
to go the other way. The former operation requires division — a very costly operation — whereas
to go the other way. The former operation requires division — a very costly operation — whereas
the latter only uses multiplication and addition and is essentially free. This asymmetry means it
is far more costly to use linear indexing with an `IndexCartesian` array than it is to use
Cartesian indexing with an `IndexLinear` array.
Expand Down
2 changes: 1 addition & 1 deletion base/reflection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,7 @@ Alternatively, in isolation `m1` and `m2` might be ordered, but if a third
method cannot be sorted with them, they may cause an ambiguity together.
For parametric types, the `ambiguous_bottom` keyword argument controls whether
`Union{}` counts as an ambiguous intersection of type parameters – when `true`,
`Union{}` counts as an ambiguous intersection of type parameters – when `true`,
it is considered ambiguous, when `false` it is not.
# Examples
Expand Down
16 changes: 8 additions & 8 deletions base/strings/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ about strings:
* Each `AbstractChar` in a string is encoded by one or more code units
* Only the index of the first code unit of an `AbstractChar` is a valid index
* The encoding of an `AbstractChar` is independent of what precedes or follows it
* String encodings are [self-synchronizing] – i.e. `isvalid(s, i)` is O(1)
* String encodings are [self-synchronizing] – i.e. `isvalid(s, i)` is O(1)
[self-synchronizing]: https://en.wikipedia.org/wiki/Self-synchronizing_code
Expand Down Expand Up @@ -46,8 +46,8 @@ AbstractString
ncodeunits(s::AbstractString) -> Int
Return the number of code units in a string. Indices that are in bounds to
access this string must satisfy `1 ≤ i ≤ ncodeunits(s)`. Not all such indices
are valid – they may not be the start of a character, but they will return a
access this string must satisfy `1 ≤ i ≤ ncodeunits(s)`. Not all such indices
are valid – they may not be the start of a character, but they will return a
code unit value when calling `codeunit(s,i)`.
# Examples
Expand Down Expand Up @@ -389,7 +389,7 @@ length(s::AbstractString) = @inbounds return length(s, 1, ncodeunits(s)::Int)
function length(s::AbstractString, i::Int, j::Int)
@boundscheck begin
0 < i ncodeunits(s)::Int+1 || throw(BoundsError(s, i))
0  j < ncodeunits(s)::Int+1 || throw(BoundsError(s, j))
0 j < ncodeunits(s)::Int+1 || throw(BoundsError(s, j))
end
n = 0
for k = i:j
Expand Down Expand Up @@ -438,8 +438,8 @@ thisind(s::AbstractString, i::Integer) = thisind(s, Int(i))
function thisind(s::AbstractString, i::Int)
z = ncodeunits(s)::Int + 1
i == z && return i
@boundscheck 0  i z || throw(BoundsError(s, i))
@inbounds while 1 < i && !(isvalid(s, i)::Bool)
@boundscheck 0 i z || throw(BoundsError(s, i))
@inbounds while 1 < i && !(isvalid(s, i)::Bool)
i -= 1
end
return i
Expand Down Expand Up @@ -498,7 +498,7 @@ function prevind(s::AbstractString, i::Int, n::Int)
z = ncodeunits(s) + 1
@boundscheck 0 < i z || throw(BoundsError(s, i))
n == 0 && return thisind(s, i) == i ? i : string_index_err(s, i)
while n > 0 && 1 < i
while n > 0 && 1 < i
@inbounds n -= isvalid(s, i -= 1)
end
return i - n
Expand Down Expand Up @@ -557,7 +557,7 @@ function nextind(s::AbstractString, i::Int, n::Int)
z = ncodeunits(s)
@boundscheck 0 i z || throw(BoundsError(s, i))
n == 0 && return thisind(s, i) == i ? i : string_index_err(s, i)
while n > 0 && i < z
while n > 0 && i < z
@inbounds n -= isvalid(s, i += 1)
end
return i + n
Expand Down
2 changes: 1 addition & 1 deletion base/strings/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function show(

# early out for short strings
len = ncodeunits(str)
len  limit - 2 && # quote chars
len limit - 2 && # quote chars
return show(io, str)

# these don't depend on string data
Expand Down
12 changes: 6 additions & 6 deletions base/strings/string.jl
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function getindex_continued(s::String, i::Int, u::UInt32)
end
n = ncodeunits(s)

(i += 1) > n && @goto ret
(i += 1) > n && @goto ret
@inbounds b = codeunit(s, i) # cont byte 1
b & 0xc0 == 0x80 || @goto ret
u |= UInt32(b) << 16
Expand Down Expand Up @@ -276,7 +276,7 @@ length(s::String) = length_continued(s, 1, ncodeunits(s), ncodeunits(s))
@inline function length(s::String, i::Int, j::Int)
@boundscheck begin
0 < i ncodeunits(s)+1 || throw(BoundsError(s, i))
0  j < ncodeunits(s)+1 || throw(BoundsError(s, j))
0 j < ncodeunits(s)+1 || throw(BoundsError(s, j))
end
j < i && return 0
@inbounds i, k = thisind(s, i), i
Expand All @@ -289,21 +289,21 @@ end
@inbounds b = codeunit(s, i)
@inbounds while true
while true
(i += 1)  n || return c
0xc0  b  0xf7 && break
(i += 1) n || return c
0xc0 b 0xf7 && break
b = codeunit(s, i)
end
l = b
b = codeunit(s, i) # cont byte 1
c -= (x = b & 0xc0 == 0x80)
x & (l 0xe0) || continue

(i += 1)  n || return c
(i += 1) n || return c
b = codeunit(s, i) # cont byte 2
c -= (x = b & 0xc0 == 0x80)
x & (l 0xf0) || continue

(i += 1)  n || return c
(i += 1) n || return c
b = codeunit(s, i) # cont byte 3
c -= (b & 0xc0 == 0x80)
end
Expand Down
2 changes: 1 addition & 1 deletion base/strings/substring.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct SubString{T<:AbstractString} <: AbstractString
ncodeunits::Int

function SubString{T}(s::T, i::Int, j::Int) where T<:AbstractString
i  j || return new(s, 0, 0)
i j || return new(s, 0, 0)
@boundscheck begin
checkbounds(s, i:j)
@inbounds isvalid(s, i) || string_index_err(s, i)
Expand Down
2 changes: 1 addition & 1 deletion doc/src/base/punctuation.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Extended documentation for mathematical symbols & functions is [here](@ref math-
| `a[]` | [array indexing](@ref man-array-indexing) (calling [`getindex`](@ref) or [`setindex!`](@ref)) |
| `[,]` | [vector literal constructor](@ref man-array-literals) (calling [`vect`](@ref Base.vect)) |
| `[;]` | [vertical concatenation](@ref man-array-concatenation) (calling [`vcat`](@ref) or [`hvcat`](@ref)) |
| `[   ]` | with space-separated expressions, [horizontal concatenation](@ref man-concatenation) (calling [`hcat`](@ref) or [`hvcat`](@ref)) |
| `[ ]` | with space-separated expressions, [horizontal concatenation](@ref man-concatenation) (calling [`hcat`](@ref) or [`hvcat`](@ref)) |
| `T{ }` | curly braces following a type list that type's [parameters](@ref Parametric-Types) |
| `{}` | curly braces can also be used to group multiple [`where`](@ref) expressions in function declarations |
| `;` | semicolons separate statements, begin a list of keyword arguments in function declarations or calls, or are used to separate array literals for vertical concatenation |
Expand Down
44 changes: 22 additions & 22 deletions doc/src/devdocs/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,32 +185,32 @@ Hello World!
| `jl_uv_write()` | `jl_uv.c` | called though [`ccall`](@ref) |
| `julia_write_282942` | `stream.jl` | function `write!(s::IO, a::Array{T}) where T` |
| `julia_print_284639` | `ascii.jl` | `print(io::IO, s::String) = (write(io, s); nothing)` |
| `jlcall_print_284639` |   |   |
| `jl_apply()` | `julia.h` |   |
| `jl_trampoline()` | `builtins.c` |   |
| `jl_apply()` | `julia.h` |   |
| `jlcall_print_284639` | | |
| `jl_apply()` | `julia.h` | |
| `jl_trampoline()` | `builtins.c` | |
| `jl_apply()` | `julia.h` | |
| `jl_apply_generic()` | `gf.c` | `Base.print(Base.TTY, String)` |
| `jl_apply()` | `julia.h` |   |
| `jl_trampoline()` | `builtins.c` |   |
| `jl_apply()` | `julia.h` |   |
| `jl_apply()` | `julia.h` | |
| `jl_trampoline()` | `builtins.c` | |
| `jl_apply()` | `julia.h` | |
| `jl_apply_generic()` | `gf.c` | `Base.print(Base.TTY, String, Char, Char...)` |
| `jl_apply()` | `julia.h` |   |
| `jl_f_apply()` | `builtins.c` |   |
| `jl_apply()` | `julia.h` |   |
| `jl_trampoline()` | `builtins.c` |   |
| `jl_apply()` | `julia.h` |   |
| `jl_apply()` | `julia.h` | |
| `jl_f_apply()` | `builtins.c` | |
| `jl_apply()` | `julia.h` | |
| `jl_trampoline()` | `builtins.c` | |
| `jl_apply()` | `julia.h` | |
| `jl_apply_generic()` | `gf.c` | `Base.println(Base.TTY, String, String...)` |
| `jl_apply()` | `julia.h` |   |
| `jl_trampoline()` | `builtins.c` |   |
| `jl_apply()` | `julia.h` |   |
| `jl_apply()` | `julia.h` | |
| `jl_trampoline()` | `builtins.c` | |
| `jl_apply()` | `julia.h` | |
| `jl_apply_generic()` | `gf.c` | `Base.println(String,)` |
| `jl_apply()` | `julia.h` |   |
| `do_call()` | `interpreter.c` |   |
| `eval_body()` | `interpreter.c` |   |
| `jl_interpret_toplevel_thunk` | `interpreter.c` |   |
| `jl_toplevel_eval_flex` | `toplevel.c` |   |
| `jl_toplevel_eval_in` | `toplevel.c` |   |
| `Core.eval` | `boot.jl` |   |
| `jl_apply()` | `julia.h` | |
| `do_call()` | `interpreter.c` | |
| `eval_body()` | `interpreter.c` | |
| `jl_interpret_toplevel_thunk` | `interpreter.c` | |
| `jl_toplevel_eval_flex` | `toplevel.c` | |
| `jl_toplevel_eval_in` | `toplevel.c` | |
| `Core.eval` | `boot.jl` | |
Since our example has just one function call, which has done its job of printing "Hello World!",
the stack now rapidly unwinds back to `main()`.
Expand Down
2 changes: 1 addition & 1 deletion doc/src/manual/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ julia> sqrt(-2.0+0im)
### How can I constrain or compute type parameters?

The parameters of a [parametric type](@ref Parametric-Types) can hold either
types or bits values, and the type itself chooses how it makes use of these parameters.
types or bits values, and the type itself chooses how it makes use of these parameters.
For example, `Array{Float64, 2}` is parameterized by the type `Float64` to express its
element type and the integer value `2` to express its number of dimensions. When
defining your own parametric type, you can use subtype constraints to declare that a
Expand Down
10 changes: 5 additions & 5 deletions doc/src/manual/integers-and-floating-point-numbers.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ The following are Julia's primitive numeric types:
| Type | Signed? | Number of bits | Smallest value | Largest value |
|:----------------- |:------- |:-------------- |:-------------- |:------------- |
| [`Int8`](@ref) || 8 | -2^7 | 2^7 - 1 |
| [`UInt8`](@ref) |   | 8 | 0 | 2^8 - 1 |
| [`UInt8`](@ref) | | 8 | 0 | 2^8 - 1 |
| [`Int16`](@ref) || 16 | -2^15 | 2^15 - 1 |
| [`UInt16`](@ref) |   | 16 | 0 | 2^16 - 1 |
| [`UInt16`](@ref) | | 16 | 0 | 2^16 - 1 |
| [`Int32`](@ref) || 32 | -2^31 | 2^31 - 1 |
| [`UInt32`](@ref) |   | 32 | 0 | 2^32 - 1 |
| [`UInt32`](@ref) | | 32 | 0 | 2^32 - 1 |
| [`Int64`](@ref) || 64 | -2^63 | 2^63 - 1 |
| [`UInt64`](@ref) |   | 64 | 0 | 2^64 - 1 |
| [`UInt64`](@ref) | | 64 | 0 | 2^64 - 1 |
| [`Int128`](@ref) || 128 | -2^127 | 2^127 - 1 |
| [`UInt128`](@ref) |   | 128 | 0 | 2^128 - 1 |
| [`UInt128`](@ref) | | 128 | 0 | 2^128 - 1 |
| [`Bool`](@ref) | N/A | 8 | `false` (0) | `true` (1) |

* **Floating-point types:**
Expand Down
Loading

0 comments on commit 1e207c2

Please sign in to comment.