Skip to content
Snippets Groups Projects
push.m 817 B
Newer Older
% if data isempty, no action
% --------------------------
% if new entrie is equal to last entry, no action
% use short circuit operator, second expression (isequal) isn't evaluate 
% if first expression (isempty) is true
% -----------------------------------------------
if isempty(self.data) || ~isequal(data, self.data{end})
  % set internal queue structure
  % ----------------------------
  self.index = self.index+1;
  %self.lifo(end+1,:) = data;
  self.data{end+1} = data;
  
  % if lifo not empty, pop dosn't follow wtih get
  % ---------------------------------------------
  if ~isempty(self.lifo)
    self.lifo = [];
  end
  
else
  return
end