Revert "Further optimization in adding to open set'"

This reverts commit 62b277015907b7d2d730c1aa6b231db6bd7aefbe.