- int i;
- bitVect *newBvp;
-
- /* if both null */
- if (!bvp1 && !bvp2)
- return NULL ;
-
- /* if one of them null then return the other */
- if (! bvp1 && bvp2 )
- return bitVectCopy (bvp2);
-
- if ( bvp1 && ! bvp2 )
- return bitVectCopy (bvp1);
-
- /* if they are not the same size */
- /* make them the same size */
- if (bvp1->bSize < bvp2->bSize)
- bvp1 = bitVectResize (bvp1,bvp2->size);
- else
- if (bvp2->bSize < bvp1->bSize)
- bvp2 = bitVectResize (bvp2,bvp1->size);
-
- newBvp = newBitVect(bvp1->size);
-
- for ( i = 0 ; i < bvp1->bSize ;i++)
- newBvp->vect[i] = bvp1->vect[i] | bvp2->vect[i];
-
-
- return newBvp;
+ int i;
+ bitVect *newBvp;
+ unsigned int *pn, *p1, *p2;
+ int nbits;
+
+ /* if both null */
+ if (!bvp1 && !bvp2)
+ return NULL;
+
+ /* if one of them null then return the other */
+ if (!bvp1 && bvp2)
+ return bitVectCopy (bvp2);
+
+ if (bvp1 && !bvp2)
+ return bitVectCopy (bvp1);
+
+ /* if they are not the same size */
+ /* make them the same size */
+ if (bvp1->bSize < bvp2->bSize)
+ bvp1 = bitVectResize (bvp1, bvp2->size);
+ else if (bvp2->bSize < bvp1->bSize)
+ bvp2 = bitVectResize (bvp2, bvp1->size);
+
+ newBvp = newBitVect (bvp1->size);
+ nbits = bvp1->bSize;
+ i = 0;
+
+ pn = (unsigned int *)newBvp->vect;
+ p1 = (unsigned int *)bvp1->vect;
+ p2 = (unsigned int *)bvp2->vect;
+
+ while ((nbits - i) >= sizeof(*pn))
+ {
+ *pn++ = *p1++ | *p2++;
+ i += sizeof(*pn);
+ }
+
+ for (; i < nbits; i++)
+ newBvp->vect[i] = bvp1->vect[i] | bvp2->vect[i];
+
+
+ return newBvp;