diff options
author | Daniel Friesel <derf@finalrewind.org> | 2017-06-01 09:38:35 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2017-06-01 09:38:35 +0200 |
commit | f9db277a72fece83bd9fed77c793a73b7e3d8360 (patch) | |
tree | ea96c5bb93355be74f0931efb3b1fdc815ce753c /lib/Kratos/DFADriver | |
parent | 286a50b1e1ee21a8dbb2c66d9cb9a69ba541e480 (diff) |
UNINITIALIZED always has ID 0
Diffstat (limited to 'lib/Kratos/DFADriver')
-rw-r--r-- | lib/Kratos/DFADriver/Model.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Kratos/DFADriver/Model.pm b/lib/Kratos/DFADriver/Model.pm index aff44cf..216f3b8 100644 --- a/lib/Kratos/DFADriver/Model.pm +++ b/lib/Kratos/DFADriver/Model.pm @@ -144,6 +144,10 @@ sub new_from_repo { @states = uniq @states; @states = sort @states; + # by convention, UNINITIALIZED always has ID 0 + @states = grep { $_ ne 'UNINITIALIZED' } @states; + unshift( @states, 'UNINITIALIZED' ); + for my $i ( 0 .. $#states ) { $self->{state}{ $states[$i] } = { id => $i, |