bmarwell commented on PR #117:
URL: https://github.com/apache/maven-wrapper/pull/117#issuecomment-1925305248

   I think we can replace this
   
   ```
     # strings start with index 1
     idx=1
   
     # lt: skip line break at end
     while [ $idx -lt "$length" ]; do
       char=$( printf "%s" "$str" | cut -c $idx )
       h=$(( ( h * 31 + $(LC_CTYPE=C printf %d "'$char") ) % 4294967296 ))
       idx=$(( idx + 1 ))
     done
   ``` 
   
   with this:
   
   ```
     while [ "$str" != "" ]; do
       char="${str%${str#?}}"
       h=$(( ( h * 31 + $(LC_CTYPE=C printf %d "'$char") ) % 4294967296 ))
       str="${T#?}"
     done
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to