File tree Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -55,22 +55,23 @@ jobs:
5555 script : |
5656 set -euo pipefail
5757
58- echo '::group::Setup environment'
59- CONDA_PATH=$(which conda)
60- eval "$(${CONDA_PATH} shell.bash hook)"
61- conda create --name ci --quiet --yes -c conda-forge python=3.11 ncurses=5 libgcc
62- conda activate ci
63- export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}"
64- echo '::endgroup::'
65-
6658 echo '::group::Install lint tools'
67- curl https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/clang-format-linux64 -o ./clang-format
68- chmod +x ./clang-format
59+ # Install clang-format via package manager (more reliable than binary download)
60+ if command -v apt-get &> /dev/null; then
61+ apt-get update && apt-get install -y clang-format
62+ elif command -v yum &> /dev/null; then
63+ yum install -y clang-tools-extra
64+ elif command -v dnf &> /dev/null; then
65+ dnf install -y clang-tools-extra
66+ else
67+ echo "No supported package manager found"
68+ exit 1
69+ fi
6970 echo '::endgroup::'
7071
7172 echo '::group::Lint C source'
7273 set +e
73- ./.github/unittest/linux/scripts/run-clang-format.py -r torchrl/csrc --clang-format-executable ./ clang-format
74+ python3 ./.github/unittest/linux/scripts/run-clang-format.py -r torchrl/csrc --clang-format-executable clang-format
7475
7576 if [ $? -ne 0 ]; then
7677 git --no-pager diff
Original file line number Diff line number Diff line change @@ -43,8 +43,7 @@ class SegmentTree {
4343 public:
4444 SegmentTree (int64_t size, const T& identity_element)
4545 : size_(size), identity_element_(identity_element) {
46- for (capacity_ = 1 ; capacity_ <= size; capacity_ <<= 1 )
47- ;
46+ for (capacity_ = 1 ; capacity_ <= size; capacity_ <<= 1 );
4847 values_.assign (2 * capacity_, identity_element_);
4948 }
5049
You can’t perform that action at this time.
0 commit comments