OSDN Git Service

[STLExtras] Add a default value to drop_begin
authorKazu Hirata <kazu@google.com>
Mon, 18 Jan 2021 18:16:34 +0000 (10:16 -0800)
committerKazu Hirata <kazu@google.com>
Mon, 18 Jan 2021 18:16:34 +0000 (10:16 -0800)
commitdc300beba7a849aac44c39ccc450a575db99bc14
tree2859643b216779a1a502ad7a02c5b2cffd07be65
parent28ea50f524b56e11b608ca1f768d2981579ebe75
[STLExtras] Add a default value to drop_begin

This patch adds the default value of 1 to drop_begin.

In the llvm codebase, 70% of calls to drop_begin have 1 as the second
argument.  The interface similar to with std::next should improve
readability.

This patch converts a couple of calls to drop_begin as examples.

Differential Revision: https://reviews.llvm.org/D94858
llvm/include/llvm/ADT/STLExtras.h
llvm/lib/Transforms/Utils/LoopUtils.cpp
llvm/unittests/ADT/STLExtrasTest.cpp