Skip to content

Commit

Permalink
Remove pointless ... from end of comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tkelman committed Apr 15, 2016
1 parent 9f4117a commit 6fb2657
Show file tree
Hide file tree
Showing 19 changed files with 58 additions and 61 deletions.
12 changes: 6 additions & 6 deletions base/asyncmap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,22 @@ function done(itr::AsyncCollector, state::AsyncCollectorState)
end

function next(itr::AsyncCollector, state::AsyncCollectorState)
# Wait if the maximum number of concurrent tasks are already running...
# Wait if the maximum number of concurrent tasks are already running
while isbusy(itr, state)
wait(state)
end

# Get index and mapped function arguments from enumeration iterator...
# Get index and mapped function arguments from enumeration iterator
(i, args), state.enum_state = next(itr.enumerator, state.enum_state)

# Execute function call and save result asynchronously...
# Execute function call and save result asynchronously
@async begin
itr.results[i] = itr.f(args...)
state.active_count -= 1
notify(state.task_done, nothing)
end

# Count number of concurrent tasks...
# Count number of concurrent tasks
state.active_count += 1

return (nothing, state)
Expand Down Expand Up @@ -116,7 +116,7 @@ function done(itr::AsyncGenerator, state::AsyncGeneratorState)
done(itr.collector, state.async_state) && isempty(itr.collector.results)
end

# Pump the source async collector if it is not already busy...
# Pump the source async collector if it is not already busy
function pump_source(itr::AsyncGenerator, state::AsyncGeneratorState)
if !isbusy(itr.collector, state.async_state) &&
!done(itr.collector, state.async_state)
Expand All @@ -133,7 +133,7 @@ function next(itr::AsyncGenerator, state::AsyncGeneratorState)
results = itr.collector.results
while !haskey(results, state.i)

# Wait for results to become available...
# Wait for results to become available
if !pump_source(itr,state) && !haskey(results, state.i)
wait(state.async_state)
end
Expand Down
6 changes: 3 additions & 3 deletions base/libc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ dup(src::RawFD,target::RawFD) = systemerror("dup",-1==
ccall((@windows? :_dup2 : :dup2),Int32,
(Int32,Int32),src.fd,target.fd))

#Wrapper for an OS file descriptor (for Windows)
# Wrapper for an OS file descriptor (for Windows)
@windows_only immutable WindowsRawSocket
handle::Ptr{Void} # On Windows file descriptors are HANDLE's and 64-bit on 64-bit Windows...
handle::Ptr{Void} # On Windows file descriptors are HANDLE's and 64-bit on 64-bit Windows
end
@windows_only Base.cconvert(::Type{Ptr{Void}}, fd::WindowsRawSocket) = fd.handle

Expand Down Expand Up @@ -171,7 +171,7 @@ function strptime(fmt::AbstractString, timestr::AbstractString)
# exposed in the API.
# tm.isdst = -1
if r == C_NULL
#TODO: better error message
# TODO: better error message
throw(ArgumentError("invalid arguments"))
end
@osx_only begin
Expand Down
22 changes: 11 additions & 11 deletions base/linalg/special.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This file is a part of Julia. License is MIT: http:https://julialang.org/license

#Methods operating on different special matrix types
# Methods operating on different special matrix types

#Interconversion between special matrix types
# Interconversion between special matrix types
convert{T}(::Type{Bidiagonal}, A::Diagonal{T})=Bidiagonal(A.diag, zeros(T, size(A.diag,1)-1), true)
convert{T}(::Type{SymTridiagonal}, A::Diagonal{T})=SymTridiagonal(A.diag, zeros(T, size(A.diag,1)-1))
convert{T}(::Type{Tridiagonal}, A::Diagonal{T})=Tridiagonal(zeros(T, size(A.diag,1)-1), A.diag, zeros(T, size(A.diag,1)-1))
Expand Down Expand Up @@ -101,12 +101,12 @@ function convert(::Type{Tridiagonal}, A::AbstractTriangular)
end
end

#Constructs two method definitions taking into account (assumed) commutativity
# Constructs two method definitions taking into account (assumed) commutativity
# e.g. @commutative f{S,T}(x::S, y::T) = x+y is the same is defining
# f{S,T}(x::S, y::T) = x+y
# f{S,T}(y::T, x::S) = f(x, y)
macro commutative(myexpr)
@assert myexpr.head===:(=) || myexpr.head===:function #Make sure it is a function definition
@assert myexpr.head===:(=) || myexpr.head===:function # Make sure it is a function definition
y = copy(myexpr.args[1].args[2:end])
reverse!(y)
reversed_call = Expr(:(=), Expr(:call,myexpr.args[1].args[1],y...), myexpr.args[1])
Expand All @@ -115,26 +115,26 @@ end

for op in (:+, :-)
SpecialMatrices = [:Diagonal, :Bidiagonal, :Tridiagonal, :Matrix]
for (idx, matrixtype1) in enumerate(SpecialMatrices) #matrixtype1 is the sparser matrix type
for matrixtype2 in SpecialMatrices[idx+1:end] #matrixtype2 is the denser matrix type
@eval begin #TODO quite a few of these conversions are NOT defined...
for (idx, matrixtype1) in enumerate(SpecialMatrices) # matrixtype1 is the sparser matrix type
for matrixtype2 in SpecialMatrices[idx+1:end] # matrixtype2 is the denser matrix type
@eval begin # TODO quite a few of these conversions are NOT defined
($op)(A::($matrixtype1), B::($matrixtype2)) = ($op)(convert(($matrixtype2), A), B)
($op)(A::($matrixtype2), B::($matrixtype1)) = ($op)(A, convert(($matrixtype2), B))
end
end
end

for matrixtype1 in (:SymTridiagonal,) #matrixtype1 is the sparser matrix type
for matrixtype2 in (:Tridiagonal, :Matrix) #matrixtype2 is the denser matrix type
for matrixtype1 in (:SymTridiagonal,) # matrixtype1 is the sparser matrix type
for matrixtype2 in (:Tridiagonal, :Matrix) # matrixtype2 is the denser matrix type
@eval begin
($op)(A::($matrixtype1), B::($matrixtype2)) = ($op)(convert(($matrixtype2), A), B)
($op)(A::($matrixtype2), B::($matrixtype1)) = ($op)(A, convert(($matrixtype2), B))
end
end
end

for matrixtype1 in (:Diagonal, :Bidiagonal) #matrixtype1 is the sparser matrix type
for matrixtype2 in (:SymTridiagonal,) #matrixtype2 is the denser matrix type
for matrixtype1 in (:Diagonal, :Bidiagonal) # matrixtype1 is the sparser matrix type
for matrixtype2 in (:SymTridiagonal,) # matrixtype2 is the denser matrix type
@eval begin
($op)(A::($matrixtype1), B::($matrixtype2)) = ($op)(convert(($matrixtype2), A), B)
($op)(A::($matrixtype2), B::($matrixtype1)) = ($op)(A, convert(($matrixtype2), B))
Expand Down
4 changes: 1 addition & 3 deletions base/managers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ function socket_reuse_port()
end
getsockname(s)
catch e
# This is an issue only on systems with lots of client connections, hence delay the warning....
# This is an issue only on systems with lots of client connections, hence delay the warning
nworkers() > 128 && warn_once("Error trying to reuse client port number, falling back to plain socket : ", e)
# provide a clean new socket
return TCPSocket()
Expand Down Expand Up @@ -408,5 +408,3 @@ function kill(manager::ClusterManager, pid::Int, config::WorkerConfig)
# at our end, which will result in a cleanup of the worker.
nothing
end


4 changes: 2 additions & 2 deletions base/pmap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ function batchsplit(c; min_batch_count=1, max_batch_size=100)
throw(ArgumentError("max_batch_size must be > 0, got $max_batch_size"))
end

# Split collection into batches, then peek at the first few batches...
# Split collection into batches, then peek at the first few batches
batches = partition(c, max_batch_size)
head, tail = head_and_tail(batches, min_batch_count)

# If there are not enough batches, use a smaller batch size...
# If there are not enough batches, use a smaller batch size
if length(head) < min_batch_count
batch_size = max(1, div(sum(length, head), min_batch_count))
return partition(flatten(head), batch_size)
Expand Down
4 changes: 2 additions & 2 deletions base/sharedarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function SharedArray(T::Type, dims::NTuple; init=false, pids=Int[])
shmmem_create_pid = myid()
s = shm_mmap_array(T, dims, shm_seg_name, JL_O_CREAT | JL_O_RDWR)
else
# The shared array is created on a remote machine....
# The shared array is created on a remote machine
shmmem_create_pid = pids[1]
remotecall_fetch(pids[1]) do
shm_mmap_array(T, dims, shm_seg_name, JL_O_CREAT | JL_O_RDWR)
Expand Down Expand Up @@ -493,7 +493,7 @@ function print_shmem_limits(slen)
"\nIf not, increase system limits and try again."
)
catch e
nothing # Ignore any errors in this...
nothing # Ignore any errors in this
end
end

Expand Down
2 changes: 1 addition & 1 deletion base/test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ end
# no failures in child test sets, there is no need to include those
# in calculating the alignment
function get_alignment(ts::DefaultTestSet, depth::Int)
# The minimum width at this depth is...
# The minimum width at this depth is
ts_width = 2*depth + length(ts.description)
# If all passing, no need to look at children
!ts.anynonpass && return ts_width
Expand Down
4 changes: 2 additions & 2 deletions base/workerpool.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type WorkerPool
channel::RemoteChannel{Channel{Int}}
count::Int

# Create a shared queue of available workers...
# Create a shared queue of available workers
WorkerPool() = new(RemoteChannel(()->Channel{Int}(typemax(Int))), 0)
end

Expand All @@ -17,7 +17,7 @@ Create a WorkerPool from a vector of worker ids.
function WorkerPool(workers::Vector{Int})
pool = WorkerPool()

# Add workers to the pool...
# Add workers to the pool
for w in workers
put!(pool, w)
end
Expand Down
2 changes: 1 addition & 1 deletion contrib/build_sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function build_sysimg(sysimg_path=nothing, cpu_target="native", userimg_path=not
error( err_msg )
end

# Copy in userimg.jl if it exists...
# Copy in userimg.jl if it exists
if userimg_path != nothing
if !isfile(userimg_path)
error("$userimg_path is not found, ensure it is an absolute path!")
Expand Down
2 changes: 1 addition & 1 deletion contrib/fixup-libgfortran.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ LIBGFORTRAN_DIRS=$(echo "$LIBGFORTRAN_DIRS" | tr " " "\n" | sort | uniq | grep -
echo "Found traces of libgfortran/libgcc in $LIBGFORTRAN_DIRS"


# Do the private_libdir libraries...
# Do the private_libdir libraries
if [ "$UNAME" = "Darwin" ]; then
cd $private_libdir
for file in openlibm quadmath.0 gfortran.3 openblas arpack lapack openspecfun; do
Expand Down
28 changes: 14 additions & 14 deletions doc/tabcomplete.jl
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#Generate list of LaTeX tab-completions supported by the Julia REPL
#as documented in doc/manual/unicode-input-table.rst
#The output will be rendered as a reStructuredText document to STDOUT
#Note: This script will download a file called UnicodeData.txt from the Unicode
#Consortium
# Generate list of LaTeX tab-completions supported by the Julia REPL
# as documented in doc/manual/unicode-input-table.rst
# The output will be rendered as a reStructuredText document to STDOUT
# Note: This script will download a file called UnicodeData.txt from the Unicode
# Consortium

include("../base/latex_symbols.jl")
include("../base/emoji_symbols.jl")

#Create list of different tab-completions for a given character
#Sometimes there is more than one way...
# Create list of different tab-completions for a given character
# Sometimes there is more than one way
vals = Dict()
for symbols in [latex_symbols, emoji_symbols], (k, v) in symbols
vals[v] = push!(get!(vals, v, ASCIIString[]), "\\"*k)
end

#Join with Unicode names to aid in lookup
# Join with Unicode names to aid in lookup
isfile("UnicodeData.txt") || download(
"http:https://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt", "UnicodeData.txt")
unicodenames = Dict()
Expand All @@ -29,14 +29,14 @@ open("UnicodeData.txt") do unidata
end
end

#Render list
#Need to do this in two passes since ReST complains if the tables aren't exactly aligned
#Pass 1. Generate strings
# Render list
# Need to do this in two passes since ReST complains if the tables aren't exactly aligned
# Pass 1. Generate strings
entries = Any[("Code point(s)", "Character(s)", "Tab completion sequence(s)", "Unicode name(s)")]
maxlen = [map(length, entries[1])...]

for (chars, inputs) in sort!([x for x in vals], by=first)
#Find all keys with this value
# Find all keys with this value
entry = (
join(map(c->"U+"*uppercase(hex(c, 5)), collect(chars)), " + "),
chars,
Expand All @@ -52,7 +52,7 @@ for (chars, inputs) in sort!([x for x in vals], by=first)
push!(entries, entry)
end

#Pass 2. Print table in ReST simple table format
# Pass 2. Print table in ReST simple table format
function underline(str, maxlen)
join(map(n->str^n, maxlen), " ")
end
Expand All @@ -64,7 +64,7 @@ for entry in entries
for (i, col) in enumerate(entry)
thisline *= rpad(col, maxlen[i], " ") * " "

#Hack round JuliaLang/julia#10825
# Hack round JuliaLang/julia#10825
if i==2 && any(x->charwidth(x)==2, collect(col))
thisline *=" "
end
Expand Down
2 changes: 1 addition & 1 deletion test/dates/adjusters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ end) == 251

# From those goofy email forwards claiming a "special, lucky month"
# that has 5 Fridays, 5 Saturdays, and 5 Sundays and that it only
# occurs every 823 years.....
# occurs every 823 years
@test length(Dates.recur(Date(2000):Dates.Month(1):Date(2016)) do dt
sum = 0
for i = 1:7
Expand Down
11 changes: 5 additions & 6 deletions test/error.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ let
return 7
end

# Success on first attempt...
# Success on first attempt
c = [0]
@test retry(foo_error)(c,0) == 7
@test c[1] == 1

# Success on second attempt...
# Success on second attempt
c = [0]
@test retry(foo_error)(c,1) == 7
@test c[1] == 2

# Success on third attempt...
# Success on third attempt
c = [0]
@test retry(foo_error)(c,2) == 7
@test c[1] == 3

# 3 failed attempts, so exception is raised...
# 3 failed attempts, so exception is raised
c = [0]
ex = @catch(retry(foo_error))(c,3)
@test ex.msg == "foo"
Expand All @@ -49,7 +49,7 @@ let
@test ex.msg == "foo"
@test c[1] == 3

# No retry if condition does not match...
# No retry if condition does not match
c = [0]
ex = @catch(retry(foo_error, e->e.msg == "bar"))(c,3)
@test typeof(ex) == ErrorException
Expand All @@ -67,5 +67,4 @@ let
@test typeof(ex) == ErrorException
@test ex.msg == "foo"
@test c[1] == 1

end
2 changes: 1 addition & 1 deletion test/fft.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ for (f,fi,pf,pfi) in ((fft,ifft,plan_fft,plan_ifft),
@test_approx_eq pifft!d3_fftd3_m3d[i] m3d[i]
end

end # if fftw_vendor() != :mkl ...
end # if fftw_vendor() != :mkl

# rfft/rfftn

Expand Down
4 changes: 2 additions & 2 deletions test/linalg/cholesky.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ for eltya in (Float32, Float64, Complex64, Complex128, BigFloat, Int)

debug && println("\ntype of a: ", eltya, " type of b: ", eltyb, "\n")

#Test error bound on linear solver: LAWNS 14, Theorem 2.1
#This is a surprisingly loose bound...
# Test error bound on linear solver: LAWNS 14, Theorem 2.1
# This is a surprisingly loose bound
x = capd\b
@test norm(x-apd\b,1)/norm(x,1) <= (3n^2 + n + n^3*ε)*ε/(1-(n+1)*ε)*κ
@test norm(apd*x-b,1)/norm(b,1) <= (3n^2 + n + n^3*ε)*ε/(1-(n+1)*ε)*κ
Expand Down
2 changes: 1 addition & 1 deletion test/netload/nettest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -184,5 +184,5 @@ function test_bidirectional(exp)
end
end

# Test 1GB of bidirectional data....
# Test 1GB of bidirectional data
test_bidirectional(9)
4 changes: 2 additions & 2 deletions test/read.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ mktempdir() do dir

tasks = []

# Create test file...
# Create test file
filename = joinpath(dir, "file.txt")
text = "C1,C2\n1,2\na,b\n"

# List of IO producers...
# List of IO producers
l = Vector{Tuple{AbstractString,Function}}()


Expand Down
2 changes: 1 addition & 1 deletion test/sorting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ for n in [0:10; 100; 101; 1000; 1001]
end

v = randn_with_nans(n,0.1)
# TODO: alg = PartialQuickSort(n) fails here....
# TODO: alg = PartialQuickSort(n) fails here
for alg in [InsertionSort, QuickSort, MergeSort],
rev in [false,true]
# test float sorting with NaNs
Expand Down
2 changes: 1 addition & 1 deletion test/spawn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ unmark(sock)
@test_throws ArgumentError reset(sock)
@test !unmark(sock)
@test readline(sock) == "Goodbye, world...\n"
#@test eof(sock) ## doesn't work...
#@test eof(sock) ## doesn't work
close(sock)

# issue #4535
Expand Down

0 comments on commit 6fb2657

Please sign in to comment.