Skip to content

Use sort! where possible #19973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 14, 2017
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
6 changes: 3 additions & 3 deletions base/REPLCompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ function completions(string, pos)
if partial_key !== nothing
matches = find_dict_matches(identifier, partial_key)
length(matches)==1 && (length(string) <= pos || string[pos+1] != ']') && (matches[1]*="]")
length(matches)>0 && return sort(matches), loc:pos, true
length(matches)>0 && return sort!(matches), loc:pos, true
else
return String[], 0:-1, false
end
Expand All @@ -457,7 +457,7 @@ function completions(string, pos)
paths[1] *= "\""
end
#Latex symbols can be completed for strings
(success || inc_tag==:cmd) && return sort(paths), r, success
(success || inc_tag==:cmd) && return sort!(paths), r, success
end

ok, ret = bslash_completions(string, pos)
Expand Down Expand Up @@ -550,7 +550,7 @@ function completions(string, pos)
end
end
append!(suggestions, complete_symbol(s, ffunc))
return sort(unique(suggestions)), (dotpos+1):pos, true
return sort!(unique(suggestions)), (dotpos+1):pos, true
end

function shell_completions(string, pos)
Expand Down
4 changes: 2 additions & 2 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ const disable_text_style = AnyDict(
available_text_colors = collect(Iterators.filter(x -> !isa(x, Integer), keys(text_colors)))
const possible_formatting_symbols = [:normal, :bold, :default]
available_text_colors = cat(1,
sort(intersect(available_text_colors, possible_formatting_symbols), rev=true),
sort(setdiff( available_text_colors, possible_formatting_symbols)))
sort!(intersect(available_text_colors, possible_formatting_symbols), rev=true),
sort!(setdiff( available_text_colors, possible_formatting_symbols)))

const available_text_colors_docstring =
string(join([string("`:", key,"`")
Expand Down
2 changes: 1 addition & 1 deletion base/pkg/query.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ function check_requirements(reqs::Requires, deps::Dict{String,Dict{VersionNumber
if !any(vn->(vn in vs), keys(deps[p]))
remaining_vs = VersionSet()
err_msg = "fixed packages introduce conflicting requirements for $p: \n"
available_list = sort(collect(keys(deps[p])))
available_list = sort!(collect(keys(deps[p])))
for (p1,f1) in fix
f1r = f1.requires
haskey(f1r, p) || continue
Expand Down