Mario Frasca <[email protected]> writes: > according to me, this looks better, I'm curious about the reactions from > the list. > > in particular, I was surprised finding a duplicated evaluation of > (string-to-number (nth col (nth row table))) inside a (dotimes (col > num-cols) (dotimes (row num-rows) …)) > > >>From 9822748dfbdb99f1ea534e695e818d7533920a61 Mon Sep 17 00:00:00 2001 > From: mfrasca <[email protected]> > Date: Sun, 28 Jun 2020 16:24:54 -0500 > Subject: [PATCH] org-plot/gnuplot-to-grid-data: code review for speed and > readability > > * lisp/org-plot.el (org-plot/gnuplot-to-grid-data): partial rewrite. > > Optimizing for speed and readability: preprocessing data in order to > simplify removal on non-plotting columns; using available functions > like set-difference and org-remove-by-index; loop over elements > instead of counting indices and invoking `nth' (in a double loop).
This took a long while, but Applied onto main. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=3db6f02f1 I adjusted the cl-lib function names and removed 0-indexed return value (this no longer works). I also reverted %f formatting as it changed the behavior for empty cells. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=3db6f02f1 Note: some of the issues above were revealed by LLM. I sometimes use LLM to make sure that I do not miss anything important during the review, aggressively filtering for non-critical issues (LLMs can always find something, so I never just trust LLM and verify everything myself). I do not copy LLM output, so everything I wrote I wrote myself at the end. -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>
