Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/client-generator-js/src/GenericsArgsInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export class GenericArgsInfo {
const toVisit: ToVisitItem[] = [{ type: topLevelType }]
const visited = new Set<DMMF.InputType>()
let item: ToVisitItem | undefined
while ((item = toVisit.shift())) {
// read the queue by index: it grows to hundreds of thousands of items and `shift()` is linear in its length
let head = 0
while ((item = toVisit[head++])) {
const { type: currentType } = item
const cached = this._cache.get(currentType)
if (cached === true) {
Expand Down
4 changes: 3 additions & 1 deletion packages/client-generator-ts/src/GenericsArgsInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export class GenericArgsInfo {
const toVisit: ToVisitItem[] = [{ type: topLevelType }]
const visited = new Set<DMMF.InputType>()
let item: ToVisitItem | undefined
while ((item = toVisit.shift())) {
// read the queue by index: it grows to hundreds of thousands of items and `shift()` is linear in its length
let head = 0
while ((item = toVisit[head++])) {
const { type: currentType } = item
const cached = this._cache.get(currentType)
if (cached === true) {
Expand Down