Skip to content

Commit 2d5e7e1

Browse files
committed
Cache generated lines
1 parent 67c2575 commit 2d5e7e1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/icalendar.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ export class IcalEvent {
137137
* @return {string[]}
138138
*/
139139
getLongLines() {
140+
if (this.lines) return this.lines;
140141
const categoryLine = this.category ? `CATEGORIES:${this.category}` : [];
141-
const arr = [
142+
const arr = this.lines = [
142143
'BEGIN:VEVENT',
143144
`DTSTAMP:${this.dtstamp}`,
144145
].concat(categoryLine).concat([
@@ -178,8 +179,7 @@ export class IcalEvent {
178179

179180
arr.push('END:VEVENT');
180181

181-
this.lines = arr;
182-
return this.lines;
182+
return arr;
183183
}
184184

185185
/**

0 commit comments

Comments
 (0)