Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -282,4 +282,4 @@ Daniel Karrasch <[email protected]> <[email protected]>
Daniel Karrasch <[email protected]> <[email protected]>

Roger Luo <[email protected]> <[email protected]>
Roger Luo <[email protected]> <[email protected]>
Roger Luo <[email protected]> <[email protected]>
2 changes: 1 addition & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4102,7 +4102,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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ docs-revise:

check-whitespace:
ifneq ($(NO_GIT), 1)
@$(JULIAHOME)/contrib/check-whitespace.sh
@$(JULIAHOME)/contrib/check-whitespace.jl
else
$(warn "Skipping whitespace check because git is unavailable")
endif
Expand Down Expand Up @@ -472,7 +472,7 @@ endif

# Include all git-tracked filenames
git ls-files >> light-source-dist.tmp

# Include documentation filenames
find doc/_build/html >> light-source-dist.tmp

Expand Down
2 changes: 1 addition & 1 deletion base/abstractset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,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 @@ -452,7 +452,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
1 change: 0 additions & 1 deletion base/missing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -463,4 +463,3 @@ macro coalesce(args...)
end
return esc(:(let val; $expr; end))
end

1 change: 0 additions & 1 deletion base/pkgid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@ function binunpack(s::String)
name = read(io, String)
return PkgId(UUID(uuid), name)
end

2 changes: 1 addition & 1 deletion base/randomdevice.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ function _make_uint_seed()
catch
return _ad_hoc_entropy() % Cuint
end
end
end
2 changes: 1 addition & 1 deletion base/reflection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1545,7 +1545,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
2 changes: 1 addition & 1 deletion base/ryu/LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
DEALINGS IN THE SOFTWARE.
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 @@ -247,7 +247,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 @@ -287,7 +287,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 @@ -300,21 +300,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 base/ttyhascolor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ end
in(key_value::Pair{Symbol,Bool}, ::TTY) = key_value.first === :color && key_value.second === get_have_color()
haskey(::TTY, key::Symbol) = key === :color
getindex(::TTY, key::Symbol) = key === :color ? get_have_color() : throw(KeyError(key))
get(::TTY, key::Symbol, default) = key === :color ? get_have_color() : default
get(::TTY, key::Symbol, default) = key === :color ? get_have_color() : default
2 changes: 1 addition & 1 deletion contrib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Installation
|[ mac/ ](https://github.com/JuliaLang/julia/blob/master/contrib/mac/) | Mac install files |
|[ windows/ ](https://github.com/JuliaLang/julia/blob/master/contrib/windows/) | Windows install files |
|[ add_license_to_files.jl ](https://github.com/JuliaLang/julia/blob/master/contrib/add_license_to_files.jl ) | Add the Julia license to files in the Julia Project |
|[ check-whitespace.sh ](https://github.com/JuliaLang/julia/blob/master/contrib/check-whitespace.sh) | Check for trailing white space |
|[ check-whitespace.jl ](https://github.com/JuliaLang/julia/blob/master/contrib/check-whitespace.jl) | Check for white space issues |
|[ commit-name.sh ](https://github.com/JuliaLang/julia/blob/master/contrib/commit-name.sh) | Computes a version name for a commit |
|[ fixup-libgfortran.sh ](https://github.com/JuliaLang/julia/blob/master/contrib/fixup-libgfortran.sh) | Include libgfortran and libquadmath for installations |
|[ fixup-libstdc++.sh ](https://github.com/JuliaLang/julia/blob/master/contrib/fixup-libstdc++.sh) | Include libstdc++ for installations |
Expand Down
55 changes: 55 additions & 0 deletions contrib/check-whitespace.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/env julia

const patterns = split("""
*.1
*.c
*.cpp
*.h
*.inc
*.jl
*.lsp
*.make
*.md
*.mk
*.rst
*.scm
*.sh
*.yml
*Makefile
""")

const errors = Set{Tuple{String,Int,String}}()

for path in eachline(`git ls-files -- $patterns`)
lineno = 0
non_blank = 0

file_err(msg) = push!(errors, (path, 0, msg))
line_err(msg) = push!(errors, (path, lineno, msg))

for line in eachline(path, keep=true)
lineno += 1
contains(line, '\r') && file_err("non-UNIX line endings")
contains(line, '\ua0') && line_err("non-breaking space")
endswith(line, '\n') || line_err("no trailing newline")
line = chomp(line)
endswith(line, r"\s") && line_err("trailing whitespace")
contains(line, r"\S") && (non_blank = lineno)
end
non_blank < lineno && line_err("trailing blank lines")
end

if isempty(errors)
println(stderr, "Whitespace check found no issues.")
exit(0)
else
println(stderr, "Whitespace check found $(length(errors)) issues:")
for (path, lineno, msg) in sort!(collect(errors))
if lineno == 0
println(stderr, "$path -- $msg")
else
println(stderr, "$path:$lineno -- $msg")
end
end
exit(1)
end
39 changes: 0 additions & 39 deletions contrib/check-whitespace.sh

This file was deleted.

1 change: 0 additions & 1 deletion contrib/fixup-libgfortran.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,3 @@ for lib in libopenblas libcholmod liblapack $SONAMES; do
done
done
done

Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@
"version" : 1,
"author" : "xcode"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"version" : 1,
"author" : "xcode"
}
}
}
2 changes: 1 addition & 1 deletion contrib/mac/frameworkapp/installresources/conclusion.rtf
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ Conclusion\
\f1 \cb1 \
\pard\pardeftab720\partightenfactor0

\f2 \cf0 \cb2 ln -s INSTALL_LOCATION/Julia.framework/Helpers/julia DIR_IN_PATH/julia}
\f2 \cf0 \cb2 ln -s INSTALL_LOCATION/Julia.framework/Helpers/julia DIR_IN_PATH/julia}
2 changes: 1 addition & 1 deletion contrib/mac/frameworkapp/installresources/readme.rtf
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ Readme\
\f2 \cb2 $HOME
\f1 \cb1 usually expands to
\f2 \cb2 /Users/username
\f1 \cb1 ).}
\f1 \cb1 ).}
2 changes: 1 addition & 1 deletion contrib/relative_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
# shells and whatnot during the build are all POSIX shells/cygwin. We rely on the build
# system itself to canonicalize to `\` when it needs to, and deal with the shell escaping
# and whatnot at the latest possible moment.
sys.stdout.write(os.path.relpath(sys.argv[2], sys.argv[1]).replace(os.path.sep, '/'))
sys.stdout.write(os.path.relpath(sys.argv[2], sys.argv[1]).replace(os.path.sep, '/'))
Loading