problem rfid0 and rfid1 serial.

hello need your help. problem rfid0 and rfid1. Required when rfid0 needs to clear the buffer so that rfid1 is scanned from 0, similar to serial.flush (); because now reading rfid0 reading rfid1 shows rfid0 values. thank you.

void rfid_0() {
  unsigned long rfidTagCode0 = 0;
  
   
  
  while (rfid0.available()>0) {
    setMessage("RFID paruoses nuskaitimui! skaitomi duomenis...");
    rfidTagCode0 = readRFIDCode();
    setMessage("Duomenys: " + String(rfidTagCode0) + String(" IN"));
    
    if(millis() > codeReadDelayMaxMillis) {
      if
      ((rfidTagCode0 == 8964939) || 
      (rfidTagCode0 == 6146163)||
      (rfidTagCode0 == 0)||
      (rfidTagCode0 == 8978869)) {
        setMessage("ATIDARYMAS");
        openPulse();//This involves a closePulse() call inside the openPulse() function.
        //setMessage("SIUNCIAMI DUOMENYS...");
        /*float ID_0 = rfidTagCode0;    
        ThingSpeak.setField(1,ID_0);
        ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
        */
        codeReadDelayMaxMillis = millis() + CODE_READ_DELAY;
        
       } else {
        setMessage("NEPAZISTAMAS ID!");
        closePulse();
      }
    } else {
      setMessage("Praleidziami tie patys duomenys");
      delay(500);
    }   

   
  } 
  //Serial.flush();
}
void rfid_1() {
  unsigned long rfidTagCode1 = 0;  

  while (rfid1.available()>0) {
    setMessage("RFID pasiruoses nuskaitimui! skaitomi duomenis...");
    rfidTagCode1 = readRFIDCode();
    setMessage("Duomenys: " + String(rfidTagCode1) + String(" OUT"));
    //postServer();
    if(millis() > codeReadDelayMaxMillis) {
      if
      ((rfidTagCode1 == 8964939) || 
      (rfidTagCode1 == 6146163)||
      (rfidTagCode1 == 0)||
      (rfidTagCode1 == 8978869)) {
        setMessage("ATIDARYMAS");
        openPulse();//This involves a closePulse() call inside the openPulse() function.
        //setMessage("SIUNCIAMI DUOMENYS...");
        /*float ID_1 = rfidTagCode1;    
        ThingSpeak.setField(2,ID_1);
        ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey); */
        codeReadDelayMaxMillis = millis() + CODE_READ_DELAY;
        
         

      } else {
        setMessage("NEPAZISTAMAS ID!");
        closePulse();
      }
    } else {
      setMessage("Praleidziami tie patys duomenys");
      delay(500);
    }   
   

  }
 //Serial.flush();
}

Sketch is incomplete and does not compile.

How does "readRFIDCode()" know which RFID reader to read?