<div>Hi, guys,I'm a newbie, If I'm wrong, please forgive me.</div>
<div>Please look at the following code (mpz/and.c):</div>
<div>void<br>mpz_and (mpz_ptr res, mpz_srcptr op1, mpz_srcptr op2)<br>{<br> mp_srcptr op1_ptr, op2_ptr;<br> mp_size_t op1_size, op2_size;<br> mp_ptr res_ptr;<br> mp_size_t res_size;<br> mp_size_t i;<br> TMP_DECL;</div>
<div> TMP_MARK;<br> op1_size = op1->_mp_size;<br> op2_size = op2->_mp_size;</div>
<div><font color="#ff0000"> op1_ptr = op1->_mp_d;<br> op2_ptr = op2->_mp_d;</font><br> res_ptr = res->_mp_d;</div>
<div> if (op1_size >= 0)<br> {<br> if (op2_size >= 0)<br> {<br> res_size = MIN (op1_size, op2_size);<br> /* First loop finds the size of the result. */<br> for (i = res_size - 1; i >= 0; i--)<br>
if ((op1_ptr[i] & op2_ptr[i]) != 0)<br> break;<br> res_size = i + 1;</div>
<div> /* Handle allocation, now then we know exactly how much space is<br> needed for the result. */<br> if (UNLIKELY (res->_mp_alloc < res_size))<br> {<br> _mpz_realloc (res, res_size);<br><font color="#ff0000"> op1_ptr = op1->_mp_d;<br>
op2_ptr = op2->_mp_d; </font></div>
<div><font color="#ff0000"> //** nobody modified op1_ptr,op1->_mp_d,op2_ptr,op2->_mp_d. Why do we need to this again?</font><br> res_ptr = res->_mp_d;<br> }</div>
<div> res->_mp_size = res_size;<br> if (LIKELY (res_size != 0))<br> mpn_and_n (res_ptr, op1_ptr, op2_ptr, res_size);<br> return;<br> }<br> else /* op2_size < 0 */<br> {<br> /* Fall through to the code at the end of the function. */<br>
}<br> }<br> else</div>
<div>{</div>
<div>....</div>
<div>{</div>
<div> </div>
<div> </div>
<div>....</div>
<div>}</div>
<div> </div>
<div>I think it is redundant.</div>