Skip to content

Commit b02ce77

Browse files
committed
Polish some comments.
1 parent af3efca commit b02ce77

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/database.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ end
156156
get(txn::Transaction, dbi::Database, key, ::Type{T}) -> T
157157
158158
Read the value at `key`, decoded as `T`. Throws `LMDBError` if `key`
159-
isn't therethe same shape as `d[k]` on a regular `AbstractDict`.
159+
isn't there, the same as `d[k]` on a regular `AbstractDict`.
160160
"""
161161
@inline function get(txn::Transaction, dbi::Database, key, ::Type{T}) where T
162162
val_ref = Ref(MDBValue())
@@ -168,8 +168,8 @@ end
168168
get(txn::Transaction, dbi::Database, key, ::Type{T}, default) -> Union{T,typeof(default)}
169169
170170
Read the value at `key`, decoded as `T`; return `default` if the key
171-
isn't there. Same shape as `Base.get(dict, key, default)`. Pass
172-
`nothing` as `default` for the `Union{T,Nothing}` form.
171+
isn't there. Mirrors `Base.get(dict, key, default)`. Pass `nothing`
172+
as `default` for the `Union{T,Nothing}` form.
173173
"""
174174
@inline function get(txn::Transaction, dbi::Database, key, ::Type{T}, default) where T
175175
val_ref = Ref(MDBValue())

src/environment.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,10 @@ isopen(env::Environment) = env.handle != C_NULL
3131
Open the LMDB environment at `path`. The directory must already exist
3232
and be writable. The configuration kwargs go through
3333
`mdb_env_set_mapsize`, `mdb_env_set_maxreaders`, and `mdb_env_set_maxdbs`;
34-
`flags` is forwarded to `mdb_env_open`. If anything fails before the
35-
open completes, the half-open env is closed before the exception
36-
propagates.
34+
`flags` is forwarded to `mdb_env_open`. If anything fails along the
35+
way, the partially-built env is closed before rethrowing.
3736
38-
The shape matches py-lmdb's `Environment(path, **kwargs)` and lmdb-rs's
37+
Matches py-lmdb's `Environment(path, **kwargs)` and lmdb-rs's
3938
`EnvironmentBuilder.open(path)`.
4039
"""
4140
function Environment(path::AbstractString; mapsize::Union{Integer,Nothing} = nothing,
@@ -64,7 +63,7 @@ end
6463
Environment(f::Function, path::AbstractString; kwargs...) -> result
6564
6665
`do`-block form. Opens the env, runs `f(env)`, closes it on the way
67-
out even if `f` throws. Returns whatever `f` returns.
66+
out, even if `f` throws. Returns whatever `f` returns.
6867
"""
6968
function Environment(f::Function, path::AbstractString; kwargs...)
7069
env = Environment(path; kwargs...)

0 commit comments

Comments
 (0)