MCPcopy Create free account
hub / github.com/MariaDB/server / Find

Method Find

storage/connect/array.cpp:439–466  ·  view source on GitHub ↗

/ Find whether a value is in an array. */ Provide a conversion limited to the Value limitation. */ /

Source from the content-addressed store, hash-verified

437/* Provide a conversion limited to the Value limitation. */
438/***********************************************************************/
439bool ARRAY::Find(PVAL valp)
440 {
441 int n;
442 PVAL vp;
443
444 if (Type != valp->GetType()) {
445 Value->SetValue_pval(valp);
446 vp = Value;
447 } else
448 vp = valp;
449
450 Inf = Bot, Sup = Top;
451
452 while (Sup - Inf > 1) {
453 X = (Inf + Sup) >> 1;
454 n = Vblp->CompVal(vp, X);
455
456 if (n < 0)
457 Sup = X;
458 else if (n > 0)
459 Inf = X;
460 else
461 return true;
462
463 } // endwhile
464
465 return false;
466 } // end of Find
467
468/***********************************************************************/
469/* ARRAY: Compare routine for a list of values. */

Callers 2

SetBitMapMethod · 0.45
BLKFILIN2Method · 0.45

Calls 3

SetValue_pvalMethod · 0.80
GetTypeMethod · 0.45
CompValMethod · 0.45

Tested by

no test coverage detected