Edit elenesgu.cpp

remove duplicated code