Done. I have implemented according your second proposal. The first is IMO a bit too compact to be easy understood - the assignment within the end condition.