pages/_plugins
google-labs-jules[bot] 2e308ed606
Optimize Google Scholar Citations Regex Definition (#3449)
💡 **What:** Moved the regex definition `/Cited by (\d+[,\d]*)/` from the
method scope to a class-level constant `CITED_BY_REGEX`.

🎯 **Why:** To improve code cleanliness and avoid potential re-definition
of the regex object in every method call (or loop), adhering to best
practices.

📊 **Measured Improvement:**
* **Baseline:** The regex was defined as a literal inside the `render`
method, which is called for each tag usage.
*   **Optimization:** The regex is now defined once as a constant.
* **Note:** Performance benchmarks were not possible in the current
environment due to missing Ruby runtime. However, this is a standard
Ruby optimization that improves maintainability and theoretically avoids
object allocation overhead in older Ruby versions or complex scenarios.
Modern Ruby optimizes literals well, but the constant approach is
cleaner and DRYer.

---
*PR created automatically by Jules for task
[10688912524063334698](https://jules.google.com/task/10688912524063334698)
started by @alshedivat*

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-01-15 21:41:10 -08:00
..
details.rb Offline mode (closes #1181) (#2312) 2024-04-08 14:51:28 -03:00
external-posts.rb Added support for default categories and tags for external posts (#3417) 2026-01-02 20:37:16 -03:00
file-exists.rb Offline mode (closes #1181) (#2312) 2024-04-08 14:51:28 -03:00
google-scholar-citations.rb Optimize Google Scholar Citations Regex Definition (#3449) 2026-01-15 21:41:10 -08:00
hide-custom-bibtex.rb Support superscripts in bibtex author names (#2512) 2024-06-19 14:34:54 -03:00
inspirehep-citations.rb [Feature] InspireHEP social and citation count badge (#2638) 2024-08-19 00:03:01 -03:00
remove-accents.rb Offline mode (closes #1181) (#2312) 2024-04-08 14:51:28 -03:00