Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd67dbc5

Browse files
Use more efficient code block and remove the other (based on suggestion)
1 parentb7003e7 commitd67dbc5

File tree

1 file changed

+8
-22
lines changed

1 file changed

+8
-22
lines changed

‎_layouts/benchmarks.html‎

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,17 @@
2121
<divclass="benchmarks-intro">
2222
{{ content }}
2323
</div>
24-
24+
2525
{% assign folders = "" | split: ", " %}
26-
{% for image in site.static_files %}
27-
{% if image.path contains 'criterion/' %}
28-
{% assign imagepath = image.path | split: "/" %}
29-
{% for subpath in imagepath %}
30-
{% if forloop.index0 == 3 %}
31-
{% assign folders = folders | append: pathName %}
32-
{% endif %}
33-
{% endfor %}
34-
{% endif %}
35-
{% endfor %}
36-
{% assign folders = folders | uniq %}
37-
38-
<!-- The code block below does exactly the same as the one above, which one is cleaner? -->
39-
<!-- {% assign folders = "" | split: ", " %}
4026
{% for folder in site.static_files %}
41-
{% if folder.path contains 'criterion/' %}
42-
{% assign temp = folder.path | split: 'criterion/' %}
43-
{% assign pathName = temp[1] | split: '/' | first %}
44-
{% assign pathName = pathName | split: ", " %}
45-
{% assign folders = folders | concat: pathName %}
46-
{% endif %}
27+
{% if folder.path contains 'criterion/' %}
28+
{% assign temp = folder.path | split: 'criterion/' %}
29+
{% assign pathName = temp[1] | split: '/' | first %}
30+
{% assign pathName = pathName | split: ", " %}
31+
{% assign folders = folders | concat: pathName %}
32+
{% endif %}
4733
{% endfor%}
48-
{% assign folders = folders | uniq %} -->
34+
{% assign folders = folders | uniq %}
4935

5036
{% if folders.size == 0 %}
5137
<pstyle="color: red;">There are no benchmarks to be displayed.</p>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp