@@ -295,7 +295,7 @@ AqlValue timeAqlValue(ExpressionContext* expressionContext,
295
295
296
296
year_month_day ymd{floor <days>(tp)};
297
297
auto day_time = make_time (tp - sys_days (ymd));
298
-
298
+
299
299
auto y = static_cast <int >(ymd.year ());
300
300
// quick sanity check here for dates outside the allowed range
301
301
if (y < 0 || y > 9999 ) {
@@ -439,7 +439,7 @@ AqlValue addOrSubtractUnitFromTimestamp(ExpressionContext* expressionContext,
439
439
break ; // We are done
440
440
}
441
441
durationUnits *= 12 ;
442
- // intentionally falls through
442
+ [[fallthrough]];
443
443
case MONTH:
444
444
durationUnits = std::modf (durationUnits, &intPart);
445
445
if (isSubtract) {
@@ -451,7 +451,7 @@ AqlValue addOrSubtractUnitFromTimestamp(ExpressionContext* expressionContext,
451
451
break ; // We are done
452
452
}
453
453
durationUnits *= 30 ; // 1 Month ~= 30 Days
454
- // intentionally falls through
454
+ [[fallthrough]];
455
455
// After this fall through the date may actually a bit off
456
456
case DAY:
457
457
// From here on we do not need leap-day handling
@@ -499,19 +499,19 @@ AqlValue addOrSubtractUnitFromTimestamp(ExpressionContext* expressionContext,
499
499
500
500
AqlValue addOrSubtractIsoDurationFromTimestamp (ExpressionContext* expressionContext,
501
501
tp_sys_clock_ms const & tp,
502
- arangodb::velocypack::StringRef duration,
502
+ arangodb::velocypack::StringRef duration,
503
503
char const * AFN, bool isSubtract) {
504
504
year_month_day ymd{floor <days>(tp)};
505
505
auto day_time = make_time (tp - sys_days (ymd));
506
-
506
+
507
507
std::match_results<char const *> durationParts;
508
508
if (!basics::regexIsoDuration (duration, durationParts)) {
509
509
::registerWarning (expressionContext, AFN, TRI_ERROR_QUERY_INVALID_DATE_VALUE);
510
510
return AqlValue (AqlValueHintNull ());
511
511
}
512
512
513
- char const * begin;
514
-
513
+ char const * begin;
514
+
515
515
begin = duration.data () + durationParts.position (2 );
516
516
int number = NumberUtils::atoi_unchecked<int >(begin, begin + durationParts.length (2 ));
517
517
if (isSubtract) {
@@ -2498,8 +2498,8 @@ void rtrimInternal(int32_t& startOffset, int32_t& endOffset, icu::UnicodeString&
2498
2498
if (unicodeStr.length () == 0 ) {
2499
2499
return ;
2500
2500
}
2501
- for (int32_t codePos = unicodeStr.moveIndex32 (endOffset, -1 );
2502
- startOffset <= codePos;
2501
+ for (int32_t codePos = unicodeStr.moveIndex32 (endOffset, -1 );
2502
+ startOffset <= codePos;
2503
2503
codePos = unicodeStr.moveIndex32 (codePos, -1 )) {
2504
2504
bool found = false ;
2505
2505
@@ -3648,47 +3648,47 @@ AqlValue Functions::DateCompare(ExpressionContext* expressionContext,
3648
3648
if (ymd1.year () != ymd2.year ()) {
3649
3649
return AqlValue (AqlValueHintBool (false ));
3650
3650
}
3651
- // intentionally falls through
3651
+ [[fallthrough]];
3652
3652
case MONTH:
3653
3653
if (rangeEnd > MONTH) {
3654
3654
break ;
3655
3655
}
3656
3656
if (ymd1.month () != ymd2.month ()) {
3657
3657
return AqlValue (AqlValueHintBool (false ));
3658
3658
}
3659
- // intentionally falls through
3659
+ [[fallthrough]];
3660
3660
case DAY:
3661
3661
if (rangeEnd > DAY) {
3662
3662
break ;
3663
3663
}
3664
3664
if (ymd1.day () != ymd2.day ()) {
3665
3665
return AqlValue (AqlValueHintBool (false ));
3666
3666
}
3667
- // intentionally falls through
3667
+ [[fallthrough]];
3668
3668
case HOUR:
3669
3669
if (rangeEnd > HOUR) {
3670
3670
break ;
3671
3671
}
3672
3672
if (time1.hours () != time2.hours ()) {
3673
3673
return AqlValue (AqlValueHintBool (false ));
3674
3674
}
3675
- // intentionally falls through
3675
+ [[fallthrough]];
3676
3676
case MINUTE:
3677
3677
if (rangeEnd > MINUTE) {
3678
3678
break ;
3679
3679
}
3680
3680
if (time1.minutes () != time2.minutes ()) {
3681
3681
return AqlValue (AqlValueHintBool (false ));
3682
3682
}
3683
- // intentionally falls through
3683
+ [[fallthrough]];
3684
3684
case SECOND:
3685
3685
if (rangeEnd > SECOND) {
3686
3686
break ;
3687
3687
}
3688
3688
if (time1.seconds () != time2.seconds ()) {
3689
3689
return AqlValue (AqlValueHintBool (false ));
3690
3690
}
3691
- // intentionally falls through
3691
+ [[fallthrough]];
3692
3692
case MILLI:
3693
3693
if (rangeEnd > MILLI) {
3694
3694
break ;
@@ -3730,15 +3730,15 @@ AqlValue Functions::DateRound(ExpressionContext* expressionContext,
3730
3730
::registerInvalidArgumentWarning (expressionContext, AFN);
3731
3731
return AqlValue (AqlValueHintNull ());
3732
3732
}
3733
-
3734
- int64_t const m = durationUnit.toInt64 ();
3733
+
3734
+ int64_t const m = durationUnit.toInt64 ();
3735
3735
if (m <= 0 ) {
3736
3736
::registerInvalidArgumentWarning (expressionContext, AFN);
3737
3737
return AqlValue (AqlValueHintNull ());
3738
3738
}
3739
-
3739
+
3740
3740
velocypack::StringRef s = durationType.slice ().stringRef ();
3741
-
3741
+
3742
3742
int64_t factor = 1 ;
3743
3743
if (s == " milliseconds" || s == " millisecond" || s == " f" ) {
3744
3744
factor = 1 ;
@@ -3755,8 +3755,8 @@ AqlValue Functions::DateRound(ExpressionContext* expressionContext,
3755
3755
return AqlValue (AqlValueHintNull ());
3756
3756
}
3757
3757
3758
- int64_t const multiplier = factor * m;
3759
-
3758
+ int64_t const multiplier = factor * m;
3759
+
3760
3760
duration<int64_t , std::milli> time = tp.time_since_epoch ();
3761
3761
int64_t t = time .count ();
3762
3762
// integer division!
@@ -4186,7 +4186,7 @@ AqlValue Functions::Sleep(ExpressionContext* expressionContext,
4186
4186
}
4187
4187
4188
4188
auto & server = application_features::ApplicationServer::server ();
4189
-
4189
+
4190
4190
double const sleepValue = value.toDouble ();
4191
4191
auto now = std::chrono::steady_clock::now ();
4192
4192
auto const endTime = now + std::chrono::milliseconds (static_cast <int64_t >(sleepValue * 1000.0 ));
@@ -4443,7 +4443,7 @@ AqlValue Functions::Unique(ExpressionContext* expressionContext, transaction::Me
4443
4443
std::unordered_set<VPackSlice, arangodb::basics::VelocyPackHelper::VPackHash, arangodb::basics::VelocyPackHelper::VPackEqual>
4444
4444
values (512 , arangodb::basics::VelocyPackHelper::VPackHash (),
4445
4445
arangodb::basics::VelocyPackHelper::VPackEqual (options));
4446
-
4446
+
4447
4447
transaction::BuilderLeaser builder (trx);
4448
4448
builder->openArray ();
4449
4449
@@ -4458,7 +4458,7 @@ AqlValue Functions::Unique(ExpressionContext* expressionContext, transaction::Me
4458
4458
builder->add (s);
4459
4459
}
4460
4460
}
4461
-
4461
+
4462
4462
builder->close ();
4463
4463
return AqlValue (builder.get ());
4464
4464
}
@@ -4845,7 +4845,7 @@ AqlValue Functions::GeoDistance(ExpressionContext* expressionContext,
4845
4845
::registerWarning (expressionContext, " GEO_DISTANCE" , res);
4846
4846
return AqlValue (AqlValueHintNull ());
4847
4847
}
4848
-
4848
+
4849
4849
if (parameters.size () > 2 && parameters[2 ].isString ()) {
4850
4850
VPackValueLength len;
4851
4851
const char * ptr = parameters[2 ].slice ().getStringUnchecked (len);
@@ -4911,17 +4911,17 @@ AqlValue Functions::GeoArea(ExpressionContext* expressionContext,
4911
4911
VPackFunctionParameters const & parameters) {
4912
4912
AqlValue p1 = extractFunctionParameterValue (parameters, 0 );
4913
4913
AqlValue p2 = extractFunctionParameterValue (parameters, 1 );
4914
-
4914
+
4915
4915
AqlValueMaterializer mat (trx);
4916
-
4916
+
4917
4917
geo::ShapeContainer shape;
4918
4918
Result res = geo::geojson::parseRegion (mat.slice (p1, true ), shape);
4919
-
4919
+
4920
4920
if (res.fail ()) {
4921
4921
::registerWarning (expressionContext, " GEO_AREA" , res);
4922
4922
return AqlValue (AqlValueHintNull ());
4923
4923
}
4924
-
4924
+
4925
4925
auto detEllipsoid = [](AqlValue const & p) {
4926
4926
if (p.isString ()) {
4927
4927
VPackValueLength len;
@@ -7038,7 +7038,7 @@ AqlValue Functions::DecodeRev(ExpressionContext* expressionContext,
7038
7038
VPackValueLength l;
7039
7039
char const * p = rev.slice ().getString (l);
7040
7040
uint64_t revInt = arangodb::basics::HybridLogicalClock::decodeTimeStamp (p, l);
7041
-
7041
+
7042
7042
if (revInt == 0 || revInt == UINT64_MAX) {
7043
7043
::registerInvalidArgumentWarning (expressionContext, " DECODE_REV" );
7044
7044
return AqlValue (AqlValueHintNull ());
@@ -7050,7 +7050,7 @@ AqlValue Functions::DecodeRev(ExpressionContext* expressionContext,
7050
7050
uint64_t millis = timeMilli % 1000 ;
7051
7051
struct tm date;
7052
7052
TRI_gmtime (timeSeconds, &date);
7053
-
7053
+
7054
7054
char buffer[32 ];
7055
7055
strftime (buffer, 32 , " %Y-%m-%dT%H:%M:%S.000Z" , &date);
7056
7056
// fill millisecond part not covered by strftime
0 commit comments