SpaceApi-archive / OpenSpaceLint

The space API validator.
http://spaceapi.net
7 stars 3 forks source link

Changing the name field leads to directory duplicates #66

Open slopjong opened 11 years ago

slopjong commented 11 years ago

If a space is changing the name field then in the directory there's one entry with the old and one entry with the new name.

Solution: when a space is being added check if there's already an entry with a name which is part of the new name and vice versa.

in_directory = false
foreach space in directory
    if space.name partof newspace.name or 
       newspace.name partof space.name
           then in_directory = true