Skip to content

Commit

Permalink
Add RedisCollection.initialize as an alternative to the constructor.
Browse files Browse the repository at this point in the history
Avoids having to write the collection type name twice in many cases.
  • Loading branch information
s-ludwig committed May 9, 2017
1 parent ebf1d60 commit cf5b3b2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions redis/vibe/db/redis/idioms.d
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ struct RedisCollection(T /*: RedisValue*/, RedisCollectionOptions OPTIONS = Redi
}

this(RedisDatabase db, Replicate!(string, ID_LENGTH) name, string suffix = null)
{
initialize(db, name, suffix);
}

void initialize(RedisDatabase db, Replicate!(string, ID_LENGTH) name, string suffix = null)
{
m_db = db;
foreach (i, N; name) {
Expand Down

0 comments on commit cf5b3b2

Please sign in to comment.