remove static analysis warning comparing self instead of setting