Optimized Row Transfer in Google Sheets

I need a faster script to move a row from various sheets to the ‘Consolidate’ tab when column 17 equals ‘DELIVERED’. See updated code below:

function quickTransfer(e) {
  const ss = SpreadsheetApp.getActiveSpreadsheet();
  const sourceSheets = ['FOOD', 'PET', 'KIND', 'Campbell', 'Other Clients'];
  const targetSheet = ss.getSheetByName('Consolidate');
  sourceSheets.forEach(sheetName => {
    const currentSheet = ss.getSheetByName(sheetName);
    if (currentSheet && e.range.getSheet().getName() === sheetName && e.range.getColumn() === 17 && e.value === 'DELIVERED') {
      const rowIndex = e.range.getRow();
      const rowData = currentSheet.getRange(rowIndex, 1, 1, 35);
      targetSheet.appendRow(rowData.getValues()[0]);
      currentSheet.deleteRow(rowIndex);
    }
  });
}

hey, i added a check to verify if the row has already been processed and wrapped the deleteRow call in a try-catch to avoid errors if trigger fires twice. works better atm!