From 945212f4c95b61c869230d4db7b66d09f5c81e07 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Wed, 4 Feb 2015 15:32:00 +0100 Subject: [PATCH] fields members name are cached --- cetodo/cetodo.d | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cetodo/cetodo.d b/cetodo/cetodo.d index 6f1de5ee..6f5f2980 100644 --- a/cetodo/cetodo.d +++ b/cetodo/cetodo.d @@ -54,8 +54,15 @@ private struct TodoItem * Enumerates the possible fields of _a TODO comment_. * They must match the published member of the widget-side class TTodoItem. */ - private enum TodoField {filename, line, text, category, assignee, priority, status} + private static enum TodoField {filename, line, text, category, assignee, priority, status} + private static string[TodoField] fFieldNames; private string[TodoField] fFields; + + static this() + { + foreach(member; EnumMembers!TodoField) + fFieldNames[member] = to!string(member); + } /** * Constructs a TODO item with its fields.