From cf5b3b23b95e37a145378b1be655569a75b2eec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Tue, 9 May 2017 10:35:33 +0200 Subject: [PATCH] Add RedisCollection.initialize as an alternative to the constructor. Avoids having to write the collection type name twice in many cases. --- redis/vibe/db/redis/idioms.d | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/redis/vibe/db/redis/idioms.d b/redis/vibe/db/redis/idioms.d index 16884a4ab7..a6b71d0cba 100644 --- a/redis/vibe/db/redis/idioms.d +++ b/redis/vibe/db/redis/idioms.d @@ -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) {